I am currently going through Colt Steele's Udemy Modern React Bootcamp and there's an exercise that requires writing a method to remove an item at an index from an array.
I know I am late to this JS party and there are probably tons of questions and rants about it on the internet...
StackOverflow doesn't dissappoint (I love how many upvotes this question has).
In a comment someone articulated pretty well what's on my mind:
At least, it seems, I am not the only one that can imagine a better world...
Anyway, I feel I am so rusty at basic algorithms that it's really a good opportunity for me to warm my brain up after months of not coding. Flex! 💪
Top comments (2)
There kinda is, though. Remove element at n-th index from array with array.splice(n, 1).
Note that second argument states how many items you remove starting at index, you could remove more than 1.
const array = [10,11,12,13];
console.log(array); // [10, 11, 12]