#variablescope — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #variablescope, aggregated by home.social.
-
new Function() Ignores Local Scope?!
Function constructor is DANGEROUS! It always runs in GLOBAL scope, ignoring any variables in the enclosing function. Your local 'x' becomes invisible. This scoping behavior will cause HIDDEN bugs!
#javascript #javascripttricks #functionconstructor #globalscope #variablescope #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #scopequirks #advancedjavascript
-
new Function() Ignores Local Scope?!
Function constructor is DANGEROUS! It always runs in GLOBAL scope, ignoring any variables in the enclosing function. Your local 'x' becomes invisible. This scoping behavior will cause HIDDEN bugs!
#javascript #javascripttricks #functionconstructor #globalscope #variablescope #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #scopequirks #advancedjavascript
-
new Function() Ignores Local Scope?!
Function constructor is DANGEROUS! It always runs in GLOBAL scope, ignoring any variables in the enclosing function. Your local 'x' becomes invisible. This scoping behavior will cause HIDDEN bugs!
#javascript #javascripttricks #functionconstructor #globalscope #variablescope #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #scopequirks #advancedjavascript
-
new Function() Ignores Local Scope?!
Function constructor is DANGEROUS! It always runs in GLOBAL scope, ignoring any variables in the enclosing function. Your local 'x' becomes invisible. This scoping behavior will cause HIDDEN bugs!
#javascript #javascripttricks #functionconstructor #globalscope #variablescope #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #scopequirks #advancedjavascript
-
new Function() Ignores Local Scope?!
Function constructor is DANGEROUS! It always runs in GLOBAL scope, ignoring any variables in the enclosing function. Your local 'x' becomes invisible. This scoping behavior will cause HIDDEN bugs!
#javascript #javascripttricks #functionconstructor #globalscope #variablescope #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #scopequirks #advancedjavascript