ECMAScript (JavaScript) 5 compatibility methods
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
MIT-LICENSE
README.textile
es5.js

README.textile

Introduction

‘es5.js’ is a set of ECMAScript (aka JavaScript) 5 compatibility methods, allowing to use some ECMAScript on all web browsers.

The methods are defined only if the native methods are not available. This means that on web browsers that implement these methods, native methods will be used instead, hence providing optimal performance.

Implemented Methods

Currently only the following new methods are implemented:

Object.create( proto ) // does not support second parameter

Function.prototype.bind( thisArg [, arg1[, arg2[, ...]]] )

Array.prototype.indexOf    ( searchElement [, fromIndex ] )
Array.prototype.lastIndexOf( searchElement [, fromIndex ] )
Array.prototype.forEach    ( callback [, thisArg ] )
Array.prototype.every      ( callback [, thisArg ] )
Array.prototype.some       ( callback [, thisArg ] )
Array.prototype.map        ( callback [, thisArg ] )
Array.prototype.filter     ( callback [, thisArg ] )
Array.prototype.reduce     ( callback [, initialValue ] )
Array.prototype.reduceRight( callback [, initialValue ] )

For more information on the above methods, and implementation, check: