在学习Javascript的prototype与__proto__区别时,发现了这样一篇介绍javascript核心的好文章。原文:javascript the core. 本想阅读后好好整理翻译下,不过网上已经有很好的翻译文章,就此省略,链接在此。这里只作简单摘要:
javascript核心概念:
An object is a collection of properties and has a single prototype object. The prototype may be either an object or the null value.
A prototype chain is a finite chain of objects which is used to implement inheritance and shared properties.
A variable object is a container of data associated with the execution context. It’s a special object that stores variables and function declarations defined in the context.
A scope chain is a list of objects that are searched for identifiers appear in the code of the context.
A closure is a combination of a code block (in ECMAScript this is a function) and statically/lexically saved all parent scopes. Thus, via these saved scopes a function may easily refer free variables.
A this value is a special object which is related with the execution context. Therefore, it may be named as a context object (i.e. an object in which context the execution context is activated). a this value is a property of the execution context, but not a property of the variable object.