I have this code sample:
var a = 'foo';
var b = {a:'2'};
b.foo //undefined
What I want is that b.foo exists and returns "2" in this example, but when creating the variable "b" the variable "a" ceases to exist when called inside the object what happens is that the name of the property becomes "a" ... how do I make the property name be the value of an existing variable?