js insert data into the first position of the array

a=[1,5,9]

// unshift 在第一个位置添加
a.unshift(7)

//结果 a=[7, 1, 5, 9]

 

Guess you like

Origin blog.csdn.net/weirdo_world/article/details/116195987