Im trying to use a JavaScript object reference to dynamically call different values of an array. Here is tje code i have
//A static call to the object that works and retutns a value
var sam = (obj.Matt);
console.log(sam)
However, if i do something like this, I am returned an undefined variable from the console log. Theoretically, the variable trent will change based on key in array.
//A dynamic reference
var trent = "Matt";
var sam = obj.trent