Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean? ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
/*
 returns false, since 'this' refers to global object and 
 '!this' becomes false
*/
function isStrictMode(){ 
 "use strict";
 return !this;
} 
/* 
 returns true, since in strict mode the keyword 'this'
 does not refer to global object, unlike traditional JS. 
 So here, 'this' is 'undefined' and '!this' becomes true.
*/

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
/*
 returns false, since 'this' refers to global object and 
 '!this' becomes false
*/
function isStrictMode(){ 
 "use strict";
 return !this;
} 
/* 
 returns true, since in strict mode the keyword 'this'
 does not refer to global object, unlike traditional JS. 
 So here, 'this' is 'undefined' and '!this' becomes true.
*/

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
/*
 returns false, since 'this' refers to global object and 
 '!this' becomes false
*/
function isStrictMode(){ 
 "use strict";
 return !this;
} 
/* 
 returns true, since in strict mode the keyword 'this'
 does not refer to global object, unlike traditional JS. 
 So here, 'this' is 'undefined' and '!this' becomes true.
*/
Formatted for readability
Source Link
BryanH
  • 6.1k
  • 3
  • 37
  • 47

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
//*
 returns false, since 'this' refers to global object and '!this' becomes false
*/
function isStrictMode(){ 
 "use strict";
 return !this;
} 
//* 
 returns true, since in strict mode, the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is 'undefined' and '!this' becomes true.
*/

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
//returns false, since 'this' refers to global object and '!this' becomes false
function isStrictMode(){ 
 "use strict";
 return !this;
} 
//returns true, since in strict mode, the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is 'undefined' and '!this' becomes true.

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
/*
 returns false, since 'this' refers to global object and '!this' becomes false
*/
function isStrictMode(){ 
 "use strict";
 return !this;
} 
/* 
 returns true, since in strict mode the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is 'undefined' and '!this' becomes true.
*/
correct - 'undefiend' in place of 'null'
Source Link
Anshul
  • 9.5k
  • 11
  • 62
  • 76

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
//returns false, since 'this' refers to global object and '!this' becomes false
function isStrictMode(){ 
 "use strict";
 return !this;
} 
//returns true, since in strict mode, the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is null'undefined' and '!this' becomes true.

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
//returns false, since 'this' refers to global object and '!this' becomes false
function isStrictMode(){ 
 "use strict";
 return !this;
} 
//returns true, since in strict mode, the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is null and '!this' becomes true.

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
 return !this;
} 
//returns false, since 'this' refers to global object and '!this' becomes false
function isStrictMode(){ 
 "use strict";
 return !this;
} 
//returns true, since in strict mode, the keyword 'this' does not refer to global object, unlike traditional JS. So here,'this' is 'undefined' and '!this' becomes true.
textified link - feel free to rollback
Source Link
Mark Rogers
  • 97.9k
  • 19
  • 92
  • 142
Loading
Source Link
Jamie Hutber
  • 28.2k
  • 54
  • 196
  • 314
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /