Hi I'm trying to access an js object property which has an slash "/" in its name.
The object its somthing like:
{
my/key : "my value"
// more stuff here...
}
I try the following construction:
myObject["my/key"]
If I try to it in Chrome DevTools it works correctly but when I execute my code i get a beautiful undefined on browser console (using console.log())
has anybody any idea of what's happening? :S
When you enclose the prop name into quotes, it works also in the code:
var obj = {
'my/key' : 'my value'
};
You can check this at jsFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With