Good evening mates!. I was considering about how can i add a new element into an existing element in an array. This is because i want to deal with colisions in hash maps by adding the new element in the index where a previous element has been stored.
Thank you all!
You can use Array.splice() method like:
yourArray.splice(indexOfCurrentElement, 1, newElement)
This will remove the current element and insert new element in its place