Eval 👾
if you know about the dot notation, but are ignorant of the subscript notation, you might write:
〰 instead of :
The eval form is much harder to read.
This form will be significantly slower because it needs to run the compiler just to execute a trivial assignment statement ❗️
#Tips #JavaScript
@ProgrammingTip
if you know about the dot notation, but are ignorant of the subscript notation, you might write:
eval("myValue = myObject." + myKey + ";"); 〰 instead of :
myvalue = myObject[myKey];
The eval form is much harder to read.
This form will be significantly slower because it needs to run the compiler just to execute a trivial assignment statement ❗️
#Tips #JavaScript
@ProgrammingTip