"use strict"; function strict() { "use strict"; // top of the function return { withStrict: function(){ return this; // undefined }(), withoutStrict: Function("return this")() }; } var really = strict(); really.withStrict;
You must specify the reason too.
Undefined !!!!! Without strict mode, the 'this' here refers to the global window object... But when you use strict mode , the keyword this no more refers to the global window object .. hence UNDEFINED
ReplyDeleteYuppppp:::)))
Correct :)
DeleteWouldn't it just return the withStrict function? As in:
ReplyDeletefunction(){ return this; }
The final line doesn't actually call the function, so it would return the function itself.