This question already has an answer here:
- Unable to access JSON property with “-” dash 3 answers
can i use dash on the end of javascript object property name like this. I could not find in any documentation that this is not valid but i got some strange results when trying to access value myProp- in this case.
var myObject = {"myProp-":"myValue"};
i can only access to this value like this myObject["myProp-"] and i would like to access like
myObject.myProp-
but i got " SyntaxError: Unexpected token } "