ECMAScript2015文档概述

简介: 4、概述 OverviewECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment.ECMAScript was originally designed to be used as a scripting language, but has become widely used as a general purpose programming languag

ECMAScript2015文档概述



4、概述 Overview


ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment.

ECMAScript was originally designed to be used as a scripting language, but has become widely used as a general purpose programming language.

Therefore the core language is specified in this document apart from any particular host environment.


ECMAScript 是面向对象的通用型编程语言,需要在宿主环境中使用,但是ECMAScript 语言的核心是不涉及这些宿主环境的


4.1 Web Scripting


Each Web browser and server that supports ECMAScript supplies its own host environment, completing the ECMAScript execution environment.


ECMAScript的两个宿主环境:web浏览器、web服务器,

不同的宿主环境提供了不同的web脚本:比如浏览器中提供window窗口对象供操作、服务器中提供request代表请求的对象来获取客户端请求内容


4.2 ECMAScript Overview


【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_

_


4.2.1 Objects


Each constructor is a function that has a property named **“prototype” **that is used to implement **prototype-based inheritance **and shared properties. Objects are created by using constructors in **new **expressions

Every object created by a constructor has an implicit reference (called the object’s prototype) to the value of its constructor’s **“prototype” **property. Furthermore, a prototype may have non-null implicit reference to its prototype, and so on; this is called the prototype chain


对象怎么来的?


原型和原型链是什么?


aHR0cHM6Ly9jZG4ubmxhcmsuY29tL3l1cXVlLzAvMjAyMC9wbmcvMTAzNTgyLzE1OTM3NDIzMDU4MzAtNWExYzMzMzMtYTYxNy00N2QzLTg2MzMtOWExYWExMTgwNzY2LnBuZw.png


4.2.2 The Strict Variant of ECMAScript


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定义了一种语言的变体 - 严格模式。


在非严格模式下可用的代码在严格模式下可能会抛出错误


4.3 术语和定义


一些重要的术语和定义:


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


4.4 本规范的组织(Organization of This Specification)


该规范的组织结构


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语法和用法的。



目录
相关文章
|
6月前
|
JavaScript 前端开发 开发者
探究ECMAScript 6的新特性
ECMAScript 6(也称为ES6或ECMAScript 2015)是JavaScript的一个重大更新,它引入了许多新特性和改进,使得JavaScript的开发更加简单和高效。在本篇博客中,我们将详细介绍ECMAScript 6的新特性。
72 1
探究ECMAScript 6的新特性
|
6月前
|
Web App开发 JavaScript 前端开发
ECMAScript6入门简介篇
ECMAScript6入门简介篇
61 5
|
6月前
|
JavaScript 前端开发 Unix
ECMAScript 2023 正式发布,有哪些新特性?
ECMAScript 2023 正式发布,有哪些新特性?
112 0
|
存储 JavaScript 前端开发
ECMAScript 2020(ES11)新特性简介
ECMAScript 2020(ES11)新特性简介
121 0
|
JavaScript 网络架构
|
JSON JavaScript 前端开发
ECMAScript6.0基础
1.什么是ES6 ECMAScript 6.0(以下简称ES6)是JavaScript语言的下一代标准,已经在2015年6月正式发布了。它的目标,是使得JavaScript语言可以用来编写复杂的大型应用程序,成为企业级开发语言。 标准的制定者有计划,以后每年发布一次标准,使用年份作为版本。因为ES6的第一个版本是在2015年发布的,所以又称ECMAScript 2015(简称ES2015)。
277 0
ECMAScript6.0基础
|
JavaScript 前端开发
ECMAScript 6新特性简介
ECMAScript 6新特性简介
ECMAScript 6新特性简介
|
JavaScript 算法 API
ECMAScript 2016(ES7)新特性简介
ECMAScript 2016(ES7)新特性简介
ECMAScript 2016(ES7)新特性简介
|
前端开发 JavaScript Java
ECMAScript 2021(ES12)新特性简介
ECMAScript 2021(ES12)新特性简介
|
存储 XML JSON
ECMAScript 2019(ES10)新特性简介
ECMAScript 2019(ES10)新特性简介