restored array.js code