underscore.js Array functions (replacements 1)

_.first === array[0]

_.initial === array.slice(0, array.length-1)

_.last === array[array.length-1]

_.rest === array.slice(x, array.length-1) n.b. where x = start position in array

 

This entry was posted in Uncategorized. Bookmark the permalink.