Array Expansion
#with array extension
const users = [
...admins,
...editors,
'rstacruz'
]
#No array expansion
const users = admins
.concat(editors)
.concat([ 'rstacruz' ])
The spread operator allows you to build new arrays in the same way. See: Spread operator
Comments