Augment.js
Modern
JavaScript
Enables use of modern JavaScript by augmenting built in objects with the latest JavaScript methods.
Never overrides any native implementations; it only adds what is missing.
Enables use of modern JavaScript by augmenting built in objects with the latest JavaScript methods.
Never overrides any native implementations; it only adds what is missing.
Include the augment.js source file before any JavaScript in which you wish to use modern JavaScript methods.
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 this
value.
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.