【发布时间】:2015-03-06 08:36:43
【问题描述】:
我正在尝试使用 shift 方法交换数组并打印它,但不确定我是否可以使用它。
Code Snippet 下方。
var points = [40, 100, 1, 5, 25, 10];
//trying to achieve like anotherPoints array
//var anotherPoints = [1, 5, 100, 40, 25, 10];
for (index = 0; index < points.length; index++) {
points.shift();
console.log(points);
}
【问题讨论】:
标签: javascript jquery arrays angularjs backbone.js