Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
2 of 13
added 158 characters in body
Ran Turner

Using Array.prototype.splice() is an easy way to achieve this

const numbers = ['one', 'two', 'four', 'five']
numbers.splice(2, 0, 'three');

console.log(numbers)

Read more about Array.prototype.splice() here

Ran Turner