QP School
Clone an array in JavaScript - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: JavaScript Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=6)
+--- Thread: Clone an array in JavaScript (/showthread.php?tid=4083)



Clone an array in JavaScript - Qomplainerz - 04-04-2023

Code:
let x = [1, 2, 3, 4];
let y = Array.from(x);
document.write(y);