Saturday, 24 August 2013

what is the equivalent of substring for an array?

what is the equivalent of substring for an array?

I simply want to extract the values of an array from [1] to the end. Is
this the only (or best) way to do it?
// example with a string
var stringy = "36781"
console.log(stringy.substring(1))
// example with an array
var array2 = [3,6,7,8,1]
array2.shift()
console.log(array2)

No comments:

Post a Comment