Home > js.ext

js.ext

Js.ext is a project mainly written in JavaScript, it's free.

JavaScript extensions

README

  • Array.prototype.extract(field) extracts a new array containing the specified field as an object
  • Array.prototype.filterByField(field, key) returns an array of objects where the given field of the object equals the given key
  • Array.prototype.map(from, to) returns an associative array mapping the from field of an object in the array to the to field of the same object.
  • Array.prototype.max() returns the maximum of an array
  • Array.prototype.min() returns the minimum of an array
  • Function.prototype.bind = function(context) Bind function wraps a function in a closure, storing a reference to the context argument in the containing scope
  • Math.signum(x) calculates the signum of the parameter