Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript empty array

var arr1 = ['a','b','c','d','e','f'];
var arr2 = arr1;  // Reference arr1 by another variable 
arr1 = [];
console.log(arr2); // Output ['a','b','c','d','e','f']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #empty #array
ADD COMMENT
Topic
Name
1+7 =