код:
var array = [
[-0.04, 0.01, 4],
[-1.09, 9, 0],
[8.1, 10.4, 7],
[15, 6, 3]
];
log("original array");
array.forEach(function(item) {
log("[" + item + "]")
});
var newArray = [];
newArray = array.slice();
log("copy array");
newArray.forEach(function(item) {
log("[" + item + "]")
});
newArray.forEach(function(item) {
item.splice(1, 1)
});
log("modified array");
newArray.forEach(function(item) {
log("[" + item + "]")
});
log("original array");
array.forEach(function(item) {
log("[" + item + "]")
});
результат:
original array
[-0.04,0.01,4]
[-1.09,9,0]
[8.1,10.4,7]
[15,6,3]
copy array
[-0.04,0.01,4]
[-1.09,9,0]
[8.1,10.4,7]
[15,6,3]
modified array
[-0.04,4]
[-1.09,0]
[8.1,7]
[15,3]
original array
[-0.04,4]
[-1.09,0]
[8.1,7]
[15,3]
https://jsfiddle.net/Quncore/xrpo5kLb/
--
Спасибо за решение и за объяснение!
сделал следующим образом: var newArray = array.map(function(item){return item.slice()})