I have a string, for example:
convert.lamp.stamp.glass.nose
that I want to create a object key 'nose' (tank object is already created) :
tank['convert']['lamp']['stamp']['glass']['nose']
How would I do that?
I got array using split
values = 'convert.lamp.stamp.glass.nose'.split('.');
now i am not sure how to use jquery's each method to create those keys.
var newstr = 'tank["'+str.split(".").join('"]["')+'"]';