Optimized Code Flashcards
1
Q
Memoization
A
A way to cache a return value of a function based on its parameters. If the parameter changes, it will still have to reevaluate the function.
2
Q
Inline Caching & Hidden Classes
A
https://richardartoul.github.io/jekyll/update/2015/04/26/hidden-classes.html
3
Q
Managing Arguments
A
Safe Ways to Use Arguments
• arguments.length
• arguments[i] when i is a valid integer
• NEVER use arguments directly without .length or [i] • STRICTLY fn.apply(y, arguments) is ok
4
Q
Things to be avoided
A
- eval()
- arguments
- for in
- with
- delete