I'm trying to get the value inside a given object using the key of another object: Ex:
I have the objects:
var obj1 = { id:'gh73f'}
var obj2 = {
gh73f : 123,
h39sg : 764,
c9wer : 921
}
I've tried:
var valor = obj2[obj1.id];
and
var valor = obj2[obj1[id]];
In none of the cases can I get the value of the key gh73f
of the obj2
.