Assume I have some JavaScript code like this:
Foo = {
alpha: { Name: "Alpha", Description: "Ipso Lorem" },
bravo: { Name: "Bravo", Description: "Nanu, Nanu" },
delta: { Name: "Fly with me", Description: "Klaatu barata nikto" }
};
Table = [ Foo.alpha, Foo.bravo, Foo.delta];
x = Table[1];
Is there a way to extract the identifier bravo
from x
? While I could easily access x.Name
or x.Description
, my goal is to obtain the name in a different context without adding redundant identifiers. Any insights on solving this dilemma would be greatly appreciated.
My intuition suggests that it's not possible, but maybe someone out there knows a clever workaround.