Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026
The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.
You can add items in different ways depending on where you need to add them, and also depending if you want to mutate the original array, or you want to create a new one.
The simplest way is to use the push() method:
const fruits = ['banana', 'pear', 'apple']
fruits.push('mango')
push() appends the item to the end of the array.