Adds an element at the second-to-last position of the array
//例如在arr的倒数第二位插入字符串'c'
//splice(index值,删除的个数(当值为0时不删除),增加的内容)
let arr=['a','b','d']
arr.splice(-1,0,'c')
console.log(arr) //'a','b','c','d'
Adds an element at the second-to-last position of the array
//例如在arr的倒数第二位插入字符串'c'
//splice(index值,删除的个数(当值为0时不删除),增加的内容)
let arr=['a','b','d']
arr.splice(-1,0,'c')
console.log(arr) //'a','b','c','d'