How can I get the value of a object in coffeescript: {text="mytext", @name="Jon"}
object.text works great but can`t get object.@name and is a 3party api json object (ebay api for example use a attribute name with @ for currency_Id), what can I do?
How can I get the value of a object in coffeescript: {text="mytext", @name="Jon"}
object.text works great but can`t get object.@name and is a 3party api json object (ebay api for example use a attribute name with @ for currency_Id), what can I do?
You can use what's called 'Bracket notation'
object['@name']
You should use this method when: (taken from this answer)
The property name contains characters not permitted in identifiers, e.g. starts with a digit†, or contains a space or dash (-), e.g. obj["my property"].
You can read up on the topic here