I want to access a specific property in an object. Using an array for example
let array = ["tom","tony", "jerry"];
let object = {
tony: "Brother",
tom: "Uncle",
jerry: "Cousin",
};
object.array[1];
I'm trying to access object.tony but what happens is that it returns object."tony" instead.
The problem is that it returns it as a string so it causes an error.
Is it possible to return array[1] not as a string?
[object[array[1]]