JavaScript简介

来自维基学院

JavaScript是一种广泛用于客户端Web开发的脚本语种,常用来给HTML网页添加动态功能,比如响应用户的各种操作。它最初由网景公司的Brendan Eich设计,是一种动态、弱类型、基于原型的语言,内置支持类。以它为基础,制定了ECMAScript标准。 虽然更常用于网页,但JavaScript也可以用于其他场合,比如服务器端编程。

关键字[编辑 | 编辑源代码]

Javascript保留的关键字有:

break、case、catch、continue、default、delete、do、else、false、finally、for、function、if、in、instanceof、new、null、return、switch、this、throw、true、try、typeof、var、void、while、with

ECMA扩展保留的关键字有:

abstract、boolean、byte、char、class、const、debugger、double、enum、export、extends、final、float、goto、implements、import、int、interface、long、native、package、private、protected、public、short、static、super、synchronized、throws、transient、volatile

as、is、namespace、use虽不是关键字,但应避免使用。

版本历史[编辑 | 编辑源代码]

版本 发布日期 基于 Netscape Navigator Mozilla Firefox Internet Explorer Opera Safari Google Chrome
1.0 1996年3月 2.0 3.0
1.1 1996年8月 3.0
1.2 1997年6月 4.0-4.05
1.3 1998年10月 ECMA-262 1st edition / ECMA-262 2nd edition 4.06-4.7x 4.0
1.4 Netscape
Server
1.5 2000年11月 ECMA-262 3rd edition 6.0 1.0 5.5 (JScript 5.5),
6 (JScript 5.6),
7 (JScript 5.7),
8 (JScript 6)
6.0,
7.0,
8.0,
9.0
1.6 2005年11月 1.5 + Array extras + Array and String generics + E4X 1.5 3.0, 3.1
1.7 2006年10月 1.6 + Pythonic generators + Iterators + let 2.0 3.2, 4.0 1.0
1.8 2008年6月 1.7 + Generator expressions + Expression closures 3.0
1.8.1 1.8 + Minor Updates 3.5
1.9 1.8.1 + ECMAScript 5 Compliance 4