这可以在不改变阵列的情况下完成吗?
let arr = [1, 2, 3, 4, 5]; arr.shift() // works but mutates the array arr.forEach(function(value) { console.log(value) }); 2 3 4 5
javascript arrays
arrays ×1
javascript ×1