Current location - Recipe Complete Network - Fat reduction meal recipes - What is scope chain, what is prototype chain, their differences, and what do they mean in js?
What is scope chain, what is prototype chain, their differences, and what do they mean in js?
For javaScript, there are only two scopes, global scope and function function. If there is a function in a function, it is also a scope. For its superior function, there is a reference to this quick action. Then such a layer-by-layer chain reference relationship is scope chain, and the prototype chain is mainly related to prototype and __proto__, which keeps the inheritance relationship of objects.