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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inline Caching & Hidden Classes

A

https://richardartoul.github.io/jekyll/update/2015/04/26/hidden-classes.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Things to be avoided

A
  • eval()
  • arguments
  • for in
  • with
  • delete
How well did you know this?
1
Not at all
2
3
4
5
Perfectly