parent
90bf5d8961
commit
f6f44edcc0
|
@ -64,3 +64,10 @@ for (var i = 0, keys = Object.keys(obj); i < keys.length; i++) {
|
|||
const key = keys[i];
|
||||
}
|
||||
```
|
||||
|
||||
## Recursive functions
|
||||
Avoid recursive functions when possible because they cannot be inlined.
|
||||
|
||||
## Loops
|
||||
Don't use foreach, it can cause megamorphic function calls (depending on the browser) and function allocations.
|
||||
It is [a lot slower than regular `for` loops](https://jsperf.com/for-vs-foreach-misko)
|
||||
|
|
Loading…
Reference in New Issue