atitit.js 各版本 and 新特性跟浏览器支持报告

atitit.js 各版本 and 新特性跟浏览器支持报告

一个完整的JavaScript实现是由以下3个不同部分组成的

  •核心(ECMAScript)——JavaScript的核心ECMAScript描述了该语言的语法和基本对象
  •文档对象模型(DOM)——DOM描述了处理网页内容的方法和接口
  •浏览器对象模型(BOM)——BOM描述了与浏览器进行交互的方法和接口


所有的主流 Web 浏览器都遵守 ECMA-262 第三版,即实现的是JavaScript 1.5版,JavaScript 1.6-1.9只是ECMAScript (JavaScript on Gecko)升级至JavaScript 2.0的临时代号。
    作者 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax

#---检测JavaScript版本
<script   language="JavaScript1.5">  
      //仅支持JavaScript   1.5的浏览器才读该部分  
      document.write('浏览器支持JavaScript   1.5<br>');  
</script>

#----js新特性
JavaScript 1.5 :在JavaScript 1.3 的基础上引入了异常处理的程序,并使之与ECMA v3兼容。
在正则表达式方面进行了多项加强。
可以有条件的定义函数。
可以想定义变量那样定义函数。
可以在try后使用多个catch,捕获不同类型的异常。
#----js1.6 新特性

    增加了对ECMAScript for XML(E4X)的支持。
    为Array对象增加了2个定位方法和5个迭代方法。
    字符串和数组泛型。
Array extras

There are seven new Array methods that can be separated into two categories, item location methods and iterative methods. The item location methods are:

    indexOf() - returns the index of the given item's first occurrence.
    lastIndexOf() - returns the index of the given item's last occurrence.

The iterative methods are:

    every() - runs a function on items in the array while that function is returning true. It returns true if the function returns true for every item it could visit.
    filter() - runs a function on every item in the array and returns an array of all items for which the function returns true.
    forEach() - runs a function on every item in the array.
    map() - runs a function on every item in the array and returns the results in an array.
    some() - runs a function on items in the array while that function returns false. It returns true if the function returns true for any item it could visit.
    
    
    JavaScript 1.7
JavaScript 1.7涵盖了JavaScript 1.6的所有功能,同时又引入了一些新的特性,包括:particular generators, iterators, array comprehensions, let expressions, and destructuring assignment。该版本在Firefox 2被引入,同时也被应用在其他使用Gecko 1.8.1为内核的产品中。

JavaScript 1.8
JavaScript 1.8覆盖了JavaScript 1.6和JavaScript 1.7的所有功能,只是做了一些小调整。具体包括以下几个方面:

    对简单的函数增加了一种简写的语法形式。
    Generator expressions
    为Array对象增加了两个遍历函数

原文地址:https://www.cnblogs.com/attilax/p/15199203.html