I have a function has just one variable(foo) and that is:
{
'a': {
'b': {
'c': 12,
'd': 'Hello World'
},
'e': [1,2,3]
}
}
and now I need to convert that to this:
{
'a/b/c': 12,
'a/b/d': 'Hello World',
'a/e': [1,2,3]
}
Including all property types like functions, true or false, arrays, numbers, strings and so on.
NOTE: Please do not write the code snippet that achieves this and don't give it to me. Just give me a few tips on what I should use and what the algorithm is. Then, if I am not able to write the code, I will tell you to give me the code.
Thanks