hasOwnProperty () only retrieves the instance not to retrieve the prototype, in is to retrieve the instance, and retrieves the prototype
The deeper the member nesting, the slower the access speed, the use of object members only if necessary.
If you want to read the same object attribute multiple times in the same function, it is best to save it to a local variable. Replacing attributes with local variables avoids the performance overhead of redundant property lookups.
Direct and local variables are accessed very quickly, and array items and object members take longer.
A local variable is faster than an extraterritorial variable because it is in the first object in the scope chain. The deeper the position of a variable in the scope chain, the longer the time it takes to access it. Global variables are always the slowest because they are always in the last loop of the scope chain.
Avoid using the WITH expression because it changes the scope chain of the run-time context. The catch clause of the try-catch expression should be treated with care because it has the same effect
Nested object members can have a significant performance impact, with minimal effort.
In general, you can improve the performance of JavaScript code by storing the object members, array entries, and foreign variables that are often used in local variables. The local variables are then accessed faster than those of the original variables.