Linked Questions
118 questions linked to/from What does "use strict" do in JavaScript, and what is the reasoning behind it?
231 votes
1 answer
162k views
How is the 'use strict' statement interpreted in Node.js? [duplicate]
I have started to explore the Node.js and wrote many demo web application, to understand the flow of Node.js, Express.js, jade, etc.. But one thing I came across recently, is the statement "use ...
89 votes
4 answers
61k views
Jshint.com requires "use strict". What does this mean? [duplicate]
Jshint.com is giving the error: Line 36: var signin_found; Missing "use strict" statement.
68 votes
2 answers
13k views
Benefits of "Use Strict" in JS [duplicate]
What are the additional benefits of "use strict" other than preventing bad coding? For instance, does it allow the script to run faster because the interpreter knows the code its optimized?
27 votes
1 answer
1k views
Why is "use strict" still a string literal? [duplicate]
Why do we still have to use quoted string literal to switch on strict in JS? Surely something a little more strongly 'typed' could be used here, like calling a built in function, say, Object.UseStrict(...
25 votes
2 answers
2k views
"use strict" in javascript [duplicate]
I have been reading many JavaScript codes recently and I was wondering of what are the benefits of using "use strict". Any idea would be very much appreciated.
32 votes
1 answer
856 views
Why using `strict mode` in JavaScript libraries? [duplicate]
Possible Duplicate: What does “use strict” do in JavaScript, and what is the reasoning behind it? Actually I know what the use strict does in JavaScript as the question asked here: What does "...
14 votes
2 answers
2k views
What's the benefit of using "function() 'use strict'" in every file? [duplicate]
I'm refactoring an old AngularJS 1.3 project. One of the things I noticed is that the person who made this started every single file of AngularJS code with: (function () { 'use strict'; angular....
7 votes
2 answers
275 views
In javavscript, what is the difference between: (function(){"use strict"}) (); and "use strict"? [duplicate]
What is the difference between: (function () {'use strict';})(); and "use strict". I don't understand when or why I would use one over the other? I think that one declares the complete external ...
7 votes
0 answers
253 views
Is 'use strict' a must to use? [duplicate]
I am currently learning JavaScript and I would like to ask if it is really necessary/advisable to do 'use strict' in all of my JavaSript functions? In line with this, will it improve the overall ...
0 votes
1 answer
249 views
'use strict' in angularjs and window.x undefined but still runs the file without error [duplicate]
I am trying to write AngularJS and JavaScript function but I have a question about the keyword 'use strict'. Say the code is something like below kept in a html file within script tag. Now remember we ...
3 votes
0 answers
239 views
"Use Strict" and the applicable scope [duplicate]
I am interested to learn when using strict mode, where does it apply to. I know that I cannot put it once in my file and be done, rather it has to be in the functions, etc. I was told if I put it in ...
1 vote
0 answers
40 views
Will "==" evaluate as "===" in JS strict mode? [duplicate]
In JS, I understand the difference between the non-strict equality operator == and the strict equality operator === and how they evaluate different expressions differently, for example 0 == false but ...
0 votes
0 answers
35 views
A Variable in JS is not deleted but here is no error? [duplicate]
I have a variable. var variable; It is variable="Hello World";. Now, without using var and deleting it: document.write(myVar); delete myVar; console.log("This should be an error because ...
2192 votes
17 answers
4.4m views
How do I empty an array in JavaScript?
Is there a way to empty an array and if so possibly with .remove()? For instance, A = [1,2,3,4]; How can I empty that?