The code only returns an error in CodeCademy. Can't find the problem
In lesson 5/30 in Introductory Objects 2 for CodeCademy, they want you to use encoding. if i run this code on jsfiddle it outputs "programmer" to the console, but in codecademy it gives the error "Oops, please try again. It looks like work on james has not been registered in the console". Any suggestions?
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]);
+3
source to share
3 answers