ECMAScript 是面向对象的通用型编程语言,需要在宿主环境中使用,但是ECMAScript 语言的核心是不涉及这些宿主环境的
Each Web browser and server that supports ECMAScript supplies its own host environment, completing the ECMAScript execution environment.
ECMAScript的两个宿主环境:web浏览器、web服务器,不同的宿主环境提供了不同的web脚本:比如浏览器中提供window窗口对象供操作、服务器中提供request代表请求的对象来获取客户端请求内容【1】何为基本数据类型?对象是什么?函数是什么?方法又是什么?
A primitive value is a member of one of the following built-in types: Undefined, Null, Boolean, Number, **String,**and **Symbol; ** an object is a member of the built-in type Object; and a function is a callable object. A function that is associated with an object via a property is called a method.
【2】内置对象有哪些,如何分类
objects that are fundamental to the runtime semantics of the language including Object, Function, Boolean, Symbol, and various **Error **objects;objects that represent and manipulate numeric values including Math, Number, and Date;the text processing objects **String **and RegExp;objects that are indexed collections of values including **Array **;keyed collections including **Map **and **Set **objects;objects supporting structured data including the **JSON **object, ArrayBuffer, and DataView;objects supporting control abstractions including generator functions and **Promise **objects;reflection objects including **Proxy **and Reflect.【3】ECMAScript 定义的操作符_ operators._ 还支持模块_modules_ _
They might do so in the interests of security, to avoid what they consider to be error-prone features, to get enhanced error checking, or for other reasons of their choosing. In support of this possibility, ECMAScript defines a strict variant of the language
出于一些场合的要求(代码安全性、健壮性),ECMAScript定义了一种语言的变体 - 严格模式。 在非严格模式下可用的代码在严格模式下可能会抛出错误
一些重要的术语和定义: undefined value primitive value used when a variable has not been assigned a value null value primitive value that represents the intentional absence of any object value method function that is the value of a property
该规范的组织结构
Clause 5 defines the notational conventions used throughout the specification.Clauses 6−9 define the execution environment within which ECMAScript programs operate.Clauses 10−16 define the actual ECMAScript programming language including its syntactic encoding and the execution semantics of all language features.Clauses 17−26 define the ECMAScript standard library. It includes the definitions of all of the standard objects that are available for use by ECMAScript programs as they execute.Clauses 10往后才是重点介绍ECMAScript语法和用法的。
【更好的阅读体验,请移步 链接】 【更多ES6文档解读,请移步 链接】