DEV Community

Discussion on: 8 neat Javascript tricks you didn't know in 4 minutes.

 
industral profile image
Alex Ivasyuv

var a = [1, 2, 3]
var b = a;
a = [];
console.log(b); // [1, 2, 3]

Some comments have been hidden by the post's author - find out more