Both push()
and unshift()
accept multiple items.
const fruits = ['banana', 'pear', 'apple']
fruits.push('mango', 'orange')
//[ 'banana', 'pear', 'apple', 'mango', 'orange' ]
const fruits = ['banana', 'pear', 'apple']
fruits.unshift('mango', 'orange')
//[ 'mango', 'orange', 'banana', 'pear', 'apple' ]