re: Understanding basics of array in javascript VIEW POST

VIEW FULL DISCUSSION

How to delete some item from array?

You can delete by using splice method

// Syntax
yourArray.splice(index, numberOfItemsTodelete)

// Real example
const colors = ['purple', 'black'];

// let say you want to delete purple color
colors.splice(0, 1);
console.log(colors); // ['black']
code of conduct - report abuse