Help


#1

I'm on " who's in your bracket ?", i dont know why this is telling me it's wrong :

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]);

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


#2

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#3

When using objects, accessing the key-value pairs is done like so: object.key, which is, in this case james.job

With that knowledge, you can infer that to set aProperty to be equal to James' job as so var aProperty = james.job

From there, you should be able to just console.log(aProperty) and it will return whatever value you have set for James

There are other methods of accessing the respective keys and values within objects, but dot notation is standard, and easier for some to remember


#4

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