I have a object like
var obj = {
floorPlan: 'hello',
dateSpan: {
from: Sat Feb 21 2015 00: 00: 00 GMT + 0530(IST),
to: Wed Feb 25 2015 00: 00: 00 GMT + 0530(IST)
}
};
and a string
var a = 'dateSpan.to';
I want to access 'obj.dateSpan.to' using the variable 'a'. How can I do it? please help.
var a = obj.dateSpan.to;???