164
rated 0 times
[
170]
[
6]
/ answers: 1 / hits: 54156
/ 9 Years ago, tue, december 29, 2015, 12:00:00
Sorry I don't know how to phrase the question title. Please help edit if possible.
I have an object like this:
{
a: 'jack',
b: {
c: 'sparrow',
d: {
e: 'hahaha'
}
}
}
I want to make it look like:
{
'a': 'jack',
'b.c': 'sparrow',
'b.d.e': 'hahaha'
}
// so that I can use it this way:
a['b.d.e']
jQuery is ok too. I know for the nested object, I can use a.b.d.e
to get hahaha
, but today I have to use it like a['b.d.e']
-_-!!!
How can I achieve this? Thanks in advance :)
More From » jquery