some slight refactoring I did while reading the source
fixed semicolon
Merge pull request #5225 from adamnemecek/master

Tiny refactoring of array.js I did while reading the source.