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?
2
Answers
You should be able to acceess properties like this:
You can use what’s called
'Bracket notation'
You should use this method when: (taken from this answer)
You can read up on the topic here