Two ways to remove an item in a specific in an array
//Mutating way const muatatedArray = ['a','b','c','d','e']; muatatedArray.splice(2,1) console.log(muatatedArray) //['a','b','d','e'] //Non-mutating way const nonMuatatedArray = ['a','b','c','d','e']; const newArray = nonMuatatedArray.filter((item'index) => !( index === 2 )); console.log(newArray) //['a','b','d','e']
20 Methods to Get to Know JavaScript Array
In the meantime, if you have any JavaScript questions, feel free to contact me. I'll do by best to create free articles to answer your questions.
Please follow me on LinkedIn / Twitter / Facebook / Codesandbox / Codepen.