SyntaxFix
Write A Post
Hire A Developer
Questions
f you need to preserve the old array, slice the old one and unshift the new value(s) to the beginning of the slice.
var oldA=[4,5,6]; newA=oldA.slice(0); newA.unshift(1,2,3) oldA+'\n'+newA /* returned value: 4,5,6 1,2,3,4,5,6 */