阿神2017-04-11 10:35:38
var nums = [1,8,9,3];
nums.push(6); // push会影响数组自身, 而不是返回新的数组, splice也一样
console.log(nums);
// [1, 8, 9, 3, 6]
PHPz2017-04-11 10:35:38
var nums = [1,5,4,6];
nums.push(7);
num =nums;
console.log(num);
这时候输出的是一个数组,数组的长度是5