当前位置: 代码迷 >> JavaScript >> Augment.js 替旧浏览器增加现代Javascript的功能支持
  详细解决方案

Augment.js 替旧浏览器增加现代Javascript的功能支持

热度:165   发布时间:2012-09-13 09:51:53.0
Augment.js 为旧浏览器增加现代Javascript的功能支持

?

  • index:?http://olivernn.github.com/augment.js/

    Augment.js能给系统内建对象增加现代Javascript功能的支持,但并不会覆盖浏览器已有的实现,它只增加不支持的功能。?

    Array.prototype.every?- Checks whether all elements in the array pass the test implemented by the provided function.

  • Array.prototype.filter?- Creates a new array with all elements that pass the test implemented by the provided function.

  • Array.prototype.forEach?- Executes a provided function once per array element.

  • Array.prototype.indexOf?- Returns the first index at which a given element can be found in the array, or -1 if it is not present.

  • Array.isArray?- Returns true if a variable is an array, false if it is not.

  • Array.prototype.lastIndexOf?- Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.

  • Array.prototype.map?- Creates a new array with the result of calling the provided function on every element in this array.

  • Array.prototype.reduce?- Applies a function against an accumulator and each value of the array (from left-to-right) to reduce the array to a single value.

  • Array.prototype.reduceRight?- Applies a function against an accumulator and each value of the array (from right-to-left) to reduce the array to a single value.

  • Array.prototype.some?- Checks whether any element in the array passes the test implemented by the provided function.

  • Date.now?- Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

  • Date.prototype.toJSON?- Returns a JSON representation of the Date object.

  • Date.prototype.toISOString?- Converts a date to a string following the ISO 8601 Extended Format.

  • Function.prototype.bind?- Returns a new function that, when called, itself calls this function in the context of the provided?thisvalue.

  • Object.keys?- Returns an array of all own enumerable properties found upon a given object, in the same order as that provided by a for-in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).

  • Object.getPrototypeOf?- Returns the prototype of the specified object.

  • String.prototype.trim?- Trims whitespace from the beginning and end of the string
    .

?

  相关解决方案