The JavaScript exception "missing : after property id" occurs when objects are created using the object initializer syntax. A colon (:
) separates keys and values for the object's properties. Somehow, this colon is missing or misplaced.
The JavaScript exception "missing : after property id" occurs when objects are created using the object initializer syntax. A colon (:
) separates keys and values for the object's properties. Somehow, this colon is missing or misplaced.
When creating objects with the object initializer syntax, a colon (:
) separates keys and values for the object's properties.
This code fails, as the equal sign can't be used this way in this object initializer syntax.
Correct would be to use a colon, or to use square brackets to assign a new property after the object has been created already.
Or alternatively:
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_colon_after_property_id