Steve Fau3,523 Points
Pushing to an array declared as a const?
const items = [1, 'two'] items.push('three', 4) console.log(items.length) // 4
^ shouldn't that throw an error?
rydavimTreehouse Moderator 18,640 Points
My understanding is that
const in this example means the variable can't be reassigned not that you can't manipulate it. However, depending on the application it may or may not be good form - functional programming would likely discourage mutating the array.
Let me know if that doesn't answer your question and I can look into it more deeply. Happy coding!