Do you have the variable 'aProperty' between brackets?


#1




I keep getting an error message, says "Oops, try again. Do you have the variable 'aProperty' between brackets? "

Oops, try again. Do you have the variable 'aProperty' between brackets?


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

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

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


#2

set to the first property name of "james"
What are the properties of james? Set aProperty to be the name (not value!) of the first property (in order as they are defined in the code) of james.
so here

var aProperty = james['job'];

you set value.you have to set the name of the first property.

next

print the value of the first property of "james"
using the variable "aProperty"


#3

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