I’m returning an object that has a key
defined like this template[body]
. Here is an example of the returned object:
object = {
method: 'patch',
authentication_token: 'a string',
template[body]: 'another string',
...
}
How can I access the second value? I’m doing something like object.template[body]
but I’m getting an error body is undefined
2
Answers
try this solution
You can access the value using
object['template[body]']
, like so:Please try this
Thanks