Question : remove multiple values from array javascript
Answered by : blue-bat-5p8499008xqq
const nums = [1, 2, 3, 4, 5, 6];
const remove = [1, 2, 4, 6];
function removeFromArray(original, remove) { return original.filter(value => !remove.includes(value));
}
Source : | Last Update : Sun, 23 Aug 20
Question : js remove several elements from array
Answered by : modern-mouse
var ar = [1, 2, 3, 4, 5, 6];ar.pop(); // returns 6console.log( ar ); // [1, 2, 3, 4, 5]
Source : https://love2dev.com/blog/javascript-remove-from-array/#remove-from-array-end | Last Update : Fri, 17 Jul 20
Question : js remove several elements from array
Answered by : modern-mouse
var arr1 = [1, 2, 3, 4, 5, 6];var arr2 = arr1; // Reference arr1 by another variable arr1 = [];console.log(arr2); // Output [1, 2, 3, 4, 5, 6]
Source : https://love2dev.com/blog/javascript-remove-from-array/#remove-from-array-end | Last Update : Fri, 17 Jul 20