123
rated 0 times
[
130]
[
7]
/ answers: 1 / hits: 34314
/ 8 Years ago, mon, august 15, 2016, 12:00:00
var obj = { prop = [1,2,3] };
The code above contains a typo, there should be a colon instead of =
. But what surprised me was the VM error message:
var obj = { prop = [1,2,3] };
^^^^^^^^^^^^^^
SyntaxError: Invalid shorthand property initializer
I searched for JavaScript shorthand properties but this term is still not clear to me. What does Shorthand property means in context of this error message?
More From » javascript