Initial code:
var ar = [1,2,3,4,5,6]
I want to shift starting from second element and add last element. I try to using shift() and splice() but doesn't work and maybe something wrong on my code.
any idea to fix it?
thank you
var ar = [1,2,3,4,5,6];
ar.splice(5,1,"0").shift();
console.log(ar)
expected result [1,3,4,5,6,0]