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