emptying an array without affecting the orginal code example
Example 1: javascript empty array
var colors = ["red","blue","green"];
colors = []; //empty the array
Example 2: empty array javascript
// set array
arr = [1,2,4];
// empty array
arr = [];