在python中,我可以像这样删除数组xs
中的第一项:
xs = xs[1:]
我怎么能用以下的javascript数组呢?
var data = {{data}}
答案 0 :(得分:2)
JavaScript splice
函数,不是jQuery的特定。
var fruit = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
var removed = fruit.splice(0, 1);
console.log(removed);
console.log(fruit);

结果为["Orange", "Apple", "Mango", "Kiwi"]
答案 1 :(得分:1)