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



目录
相关文章
|
数据可视化 关系型数据库 MySQL
宝塔面板数据库迁移一种小技巧方式
要迁移数据,那么一般情况下两边服务器的mysql版本、配置应该保持一致 将变化的可能性尽可能减低,否则你不会预料到迁移过后会发生什么事.. 其实这个方法只是在恢复数据的时候一种小灵活的手法。主体逻辑还是没有变化的。
821 0
宝塔面板数据库迁移一种小技巧方式
|
6月前
|
人工智能 IDE 开发工具
寻找Cursor的替代品:10款AI编程工具深度评测与推荐·优雅草卓伊凡
寻找Cursor的替代品:10款AI编程工具深度评测与推荐·优雅草卓伊凡
4919 18
寻找Cursor的替代品:10款AI编程工具深度评测与推荐·优雅草卓伊凡
|
6月前
|
SQL 数据库 开发者
Python中使用Flask-SQLAlchemy对数据库的增删改查简明示例
这样我们就对Flask-SQLAlchemy进行了一次简明扼要的旅程,阐述了如何定义模型,如何创建表,以及如何进行基本的数据库操作。希望你在阅读后能对Flask-SQLAlchemy有更深入的理解,这将为你在Python世界中从事数据库相关工作提供极大的便利。
655 77
|
JavaScript 前端开发
JS如何判断一个对象是否为数组?
JS如何判断一个对象是否为数组?
317 0
|
JSON C++ 数据格式
如何在 Visual Studio Code 中使用 Prettier 格式化代码
如何在 Visual Studio Code 中使用 Prettier 格式化代码
1396 0
|
JavaScript 前端开发 开发者
Vue 3中的Proxy
【10月更文挑战第23天】Vue 3中的`Proxy`为响应式系统带来了更强大、更灵活的功能,解决了Vue 2中响应式系统的一些局限性,同时在性能方面也有一定的提升,为开发者提供了更好的开发体验和性能保障。
519 7
|
Python
Flask学习笔记(二):基于Flask框架上传图片到服务器端并原名保存
关于如何使用Flask框架上传图片到服务器端并以其原名保存的教程。
495 1
|
资源调度 JavaScript Windows
'vue-cli-service' 不是内部或外部命令,也不是可运行的程序问题解决
【5月更文挑战第7天】'vue-cli-service' 不是内部或外部命令,也不是可运行的程序问题解决
20192 3
|
机器学习/深度学习 人工智能 TensorFlow
利用深度学习进行图像识别的基本原理与实践
【8月更文挑战第27天】在这篇文章中,我们将探索图像识别技术的核心原理,并借助深度学习框架实现一个基本的图像识别模型。通过简洁的代码示例和直观的解释,我们旨在向读者展示如何从零开始构建自己的图像识别系统,以及这一过程中可能遇到的挑战和解决方案。无论你是AI领域的初学者还是有一定基础的开发者,这篇文章都将为你提供有价值的见解和指导。