Who's in your Bracket (Needs debugging)


#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(aProperty);


#2

You should make this "programmer". As the question says "In line 7, set aProperty to a string of the first property in james (ie. the job property)."

Then after you do this call your variable james but put your new variable you just made inside of its square brackets.

let me know if that makes sense or if you need further explanation.


#3

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

What goes in the "console.log"? Or does anything go there?


#4

Why are there brackets here?

Like I said before after that you then need to wrote something like this james[ ];with your new variable inside of the square brackets.

The goal of this exercise is to console.log(aProperty) with the result of "programmer".


#5

var aProperty = james [job];

Is this any better?


#6

try something like this
var aProperty = james['job'];
james[aProperty];

Do you get what I am doing here?


#7

You're stating that James' job is the same as aProperty?


#8

Essentially, have you got his one now?


#9

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

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

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

Error:
Oops, try again. It looks like james' job was not logged to the console.


#10

Hm this code passes for me, try refreshing the page.


#11

Okay. I'll try that. Thanks!


#12

That worked. How odd.


#13

Refreshing removes the cache

Glad that worked was worried for a sec :smile:


#14

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