Skip to main content
Rollback to Revision 27
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave me thisthe following error:

Problem at line 1 character 1: Missing "use strict" statement.

WhatDoing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant? 

Do modernany of the current browsers supportrespond to the "use strict"; string or is it for future use?

What does "use strict" do?

JSLint gave me this error:

Problem at line 1 character 1: Missing "use strict" statement.

What is "use strict";? Do modern browsers support it?

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant? 

Do any of the current browsers respond to the "use strict"; string or is it for future use?

Shorten for quicker reading.
Source Link
Mateen Ulhaq
  • 27.9k
  • 21
  • 121
  • 155

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the followingme this error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So whatWhat is "use strict"; all about, what does it imply, and is it still relevant?

  Do any of the currentmodern browsers respond to the "use strict"; string or issupport it for future use?

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant?

  Do any of the current browsers respond to the "use strict"; string or is it for future use?

What does "use strict" do?

JSLint gave me this error:

Problem at line 1 character 1: Missing "use strict" statement.

What is "use strict";? Do modern browsers support it?

Post Reopened by DarthJDG, Kami, Narendra Jadhav, SpiritCrusher, Andrii Omelchenko
Post Closed as "Needs more focus" by Samuel Liew
Rollback to Revision 19
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly, it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant?

Do any of the current browsers respond to the "use strict"; string or is it for future use?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly, it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant?

Do any of the current browsers respond to the "use strict"; string or is it for future use?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.

So what is "use strict"; all about, what does it imply, and is it still relevant?

Do any of the current browsers respond to the "use strict"; string or is it for future use?

added 1 character in body
Source Link
Vikrant
  • 5.1k
  • 18
  • 53
  • 77
Loading
Rollback to Revision 23
Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
Attempted to make the title more concise
Link
Steve Chambers
  • 39.8k
  • 29
  • 179
  • 222
Loading
Rollback to Revision 21
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
For contesting this edit, go to the meta discussion http://meta.stackoverflow.com/questions/316884/should-we-add-links-between-duplicate-questions-in-different-languages
Source Link
Peter Olson
  • 143.5k
  • 49
  • 209
  • 249
Loading
Rollback to Revision 19
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
added 164 characters in body
Source Link
Peter Olson
  • 143.5k
  • 49
  • 209
  • 249
Loading
Burninating [crockford] per http://meta.stackoverflow.com/q/253760/359284
Link
Kevin Brown-Silva
  • 41.8k
  • 42
  • 207
  • 243
Loading
Rollback to Revision 16
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
deleted 8 characters in body
Source Link
Amit Joki
  • 59.4k
  • 7
  • 80
  • 96
Loading
Rollback to Revision 12
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
Rollback to Revision 13
Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
edited tags
Link
Matt Fenwick
  • 49.3k
  • 24
  • 130
  • 198
Loading
Rollback to Revision 9
Source Link
Matt Fenwick
  • 49.3k
  • 24
  • 130
  • 198
Loading
Question Protected by Mayank K. Swami
use-strict tag
Link
hippietrail
  • 17.3k
  • 21
  • 113
  • 181
Loading
Rollback to Revision 8
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
Rollback to Revision 7
Source Link
Matt Fenwick
  • 49.3k
  • 24
  • 130
  • 198
Loading
Rollback to Revision 6
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading