Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
You might want to add an item to the beginning of the array.
In this case you can use the unshift() method:
const fruits = ['banana', 'pear', 'apple']
fruits.unshift('orange')
fruits //[ 'orange', 'banana', 'pear', 'apple' ]