clear an entire array javascript code example Example: empty array javascript // set array arr = [1,2,4]; // empty array arr = [];