Update article.md
The ol' evade -> avoid.
This commit is contained in:
parent
646989dd47
commit
172d3dfb86
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ Why was `__proto__` replaced by the functions `getPrototypeOf/setPrototypeOf`? T
|
|||
```warn header="Don't change `[[Prototype]]` on existing objects if speed matters"
|
||||
Technically, we can get/set `[[Prototype]]` at any time. But usually we only set it once at the object creation time, and then do not modify: `rabbit` inherits from `animal`, and that is not going to change.
|
||||
|
||||
And JavaScript engines are highly optimized to that. Changing a prototype "on-the-fly" with `Object.setPrototypeOf` or `obj.__proto__=` is a very slow operation, it breaks internal optimizations for object property access operations. So evade it unless you know what you're doing, or JavaScript speed totally doesn't matter for you.
|
||||
And JavaScript engines are highly optimized to that. Changing a prototype "on-the-fly" with `Object.setPrototypeOf` or `obj.__proto__=` is a very slow operation, it breaks internal optimizations for object property access operations. So avoid it unless you know what you're doing, or JavaScript speed totally doesn't matter for you.
|
||||
```
|
||||
|
||||
## "Very plain" objects [#very-plain]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue