173
rated 0 times
[
179]
[
6]
/ answers: 1 / hits: 16428
/ 12 Years ago, thu, may 24, 2012, 12:00:00
I just want to confirm if the following two Javascript statements produces the same results, as it seems to me:
First:
var element = my_array.splice(0,1)[0];
Second:
var element = my_array.shift();
I want to substitute the first by the second, in my own code, to improve readability. Can I do this?
More From » arrays