I have 2 objects like this
var row = {
destination: {
id: 1,
name: 'test'
},
name: 'test2',
source: 'source2'
};
var obj = [{'index': 'name'}, {'index': 'source'}, {'index': 'destination.name'}];
Now looping on obj I can get values of row but not for the destination.name
for(var i=0;i<obj.length;i++){
console.log(row[obj.index]);
}
Output
test2
source2
undefined