From https://raw.github.com/plusdude/array-generics/master/array.generics.js