JavaScript

From Sixsigma
Jump to: navigation, search

Clone an array with slice

 var a = [ 1, 2, 3 ];
 var b = a.slice( 0 );
 WScript.StdOut.WriteLine( b ); // 1, 2, 3
 WScript.StdOut.WriteLine( a == b ); // False