es6 find object in array and remove code example
Example 1: javascript array clear
var cars = ["mazda","honda","tesla"];
cars = []; // clear/empty the array
Example 2: js array delete specific element
var ar = [1, 2, 3, 4, 5, 6];
ar.pop(); // returns 6
console.log( ar ); // [1, 2, 3, 4, 5]