take out of array property from an object javascript code example
Example 1: remove id from array javascript
const drinks = ['Cola', 'Lemonade', 'Coffee', 'Water'];
const id = 2;
const removedDrink = drinks.splice(id, 1);
Example 2: remove element from array javascript
let values = [1,2,3,4,5,7,8,9,10]
// only keep n values from an array
values.length = 5