Why Doesn't This Work?


#1

var james = {
job: "programmer",
married: false
};

// set to the first property name of "james"
var aProperty = "job";

// print the value of the first property of "james"
// using the variable "aProperty"
console.log(james[aProperty]);

Why doesn't this work?


Who's in Your Bracket?
#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.