I've implemented a bunch of Array library functions in stdlib/arrays.js . The code includes unit tests. Specifically the following functions are implemented:
Array.prototype.toString Array.prototype.concat Array.prototype.join Array.prototype.pop Array.prototype.push Array.prototype.reverse Array.prototype.shift Array.prototype.slice Array.prototype.sort Array.prototype.splice Array.prototype.unshift Array.prototype.indexOf Array.prototype.lastIndexOf Array.prototype.forEach Array.prototype.map Array.prototype.filter
For the sort function I have used a non-recursive version of mergesort which I designed from scratch (I'd be interested to know if this algorithm already exists).
To activate the functions, the assignments of the form
Array.prototype.array_toString = array_toString;
must be changed to
Array.prototype.toString = array_toString;
Marc