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

https://www.youtube.com/watch?v=LKJ_9YKFSKY

new Function Ignores Local Scope?! #javascriptwtf

YouTube

PHP Static Variable Trap

Watch this! PHP static variables persist across function calls. See what happens when you call the function twice. Game changer!

#php #phptricks #codingtips #programmingtutorial #phpstaticvariables #functionscope #phpmemory #phpquiz #codingchallenge #phpshorts #phpadvanced #variablescope

https://www.youtube.com/watch?v=eWWcAmfs1yI

PHP Static Variable Trap #PHP

YouTube