I did this by accident...
var numbers = [1, 2, 3, 4];
numbers.push[5];
Why wasn't there an error message?
push needs parentheses, not square brackets. It was just a simple typo. I wasn't paying close enough attention to what I was doing... but why wasn't there an error message?
As far as I can tell, the numbers array wasn't modified in any way. It just did... nothing.
undefined- any property (functions are just properties in javascript anyway) can have properties ...5on the property namedpush. There isn't a syntax error there, just a logic one