Linked Questions
118 questions linked to/from What does "use strict" do in JavaScript, and what is the reasoning behind it?
7 votes
3 answers
2k views
JavaScript 'use strict'; inside functions
Tested some js code in Chrome Dev Console and I'm a bit confused. I know that in strict mode functions that are not methods of an object when referred to this keyword should receive undefined instead ...
3 votes
1 answer
5k views
How to draw a QPixmap with rounded corners?
I have inherited from QGraphicsPolygonItem and would like to draw a QPixmap on the top of the item. The item itself and the pixmap should be drawn with rounded corners. How would you this?
3 votes
3 answers
3k views
Is it possible to run ES6 in Node REPL?
Is there any way to run ES6 in Node REPL (Read Evaluate Print Loop)? While running ES 6 commands, I am getting error as shown in the screenshot. Appreciate if someone can help me to configure Node to ...
2 votes
2 answers
919 views
Backbone and RequireJS conflicts - instances or constructors?
Could someone explain the fundamental difference between: define(['backbone'], function(Backbone) { MyModel = Backbone.Model.extend({ }); }); define(['backbone', 'models/mymodel'], function(...
2 votes
1 answer
8k views
How to require jQuery in Node using Gulp?
Building a PWA on top of NodeJS. Utilizing gulp to processes package/bundle for production. Also using jQuery. Receiving the error: Uncaught ReferenceError: jQuery is not defined package.json: "...
3 votes
1 answer
2k views
'use strict' on npm
Is there any reason why I should consider not using 'use strict' in a node module published via npm? Is it 'safe' to do that if I want others to be able to use it? EDIT: I asked this question ...
6 votes
1 answer
2k views
Does "use strict" in the constructor extend to prototype methods?
I'm trying to figure out whether the definition of 'use strict' extends to the prototype methods of the constructor. Example: var MyNamespace = MyNamespace || {}; MyNamespace.Page = function() { ...
4 votes
2 answers
1k views
JavaScript: Code sample of Global Variables "Use Strict" Explanation
I am learning jquery and started my first attempt at building a form validation script based on what I know so far (which isnt much). This is really only the Radio button portion of the validation ...
7 votes
2 answers
1k views
import / export in ES6 Transpilers [duplicate]
This is not a duplicate of below questions which is dealing with browser specific questions. I'm expecting an answer whether import / export will work in Client side or not. ECMA 6 Not working ...
3 votes
3 answers
2k views
Can we write "use strict" at the top of our JS file and It would validate all functions and statements?
Do we have to write use strict in all of the functions we have in our JS files or would writing it at the top of the code be enough to validate everything?
2 votes
3 answers
1k views
What does JavaScript's strict mode exactly do regarding implicit global declarations?
From MDN article about strict mode: First, strict mode makes it impossible to accidentally create global variables. In normal JavaScript mistyping a variable in an assignment creates a new ...
4 votes
5 answers
1k views
How to use "this" inside an immediate function
i'm trying to encapsolate my code inside an immediate function that later on will be accessed via the global variable x and act like a "module". code: var x = (function () { console.log(x); // ...
2 votes
1 answer
597 views
using "use strict" and variable scope
I've started using "use strict" for my scripts recently. One of the behaviors I noticed is that this.[name of variable] doesn't work for an object. For example: (function(){ "use strict"; window....
0 votes
1 answer
2k views
Confused about 'use strict' in JavaScript/nodejs
When I added a linter to my code, I noticed I got a lot of errors regarding 'use strict'; so I added the line to a lot of files. However this broke some code in my main app.js file, which looks like ...
0 votes
3 answers
158 views
Why does `this` not point to the window object?
In the browser, it is expected that this, inside an IIFE, points to the window object. However, it is undefined in this case. (function () { "use strict"; console.log(this) // undefined ...