Dot notation problem

Dot notation problem
0

#1

Tell us what’s happening:

I am having a problem with the dot notation

Your code so far

// Setup
var testObj = {
  "hat": "ballcap",
  "shirt": "jersey",
  "shoes": "cleats"
};

// Only change code below this line

var hatValue =  "ballcap";      // Change this line
var shirtValue = "jersey";    // Change this line

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:


#2

You can think of objects as simply a collection of values. In this example, you have an object called testObj that contains three values. Now to access a value in an object, you can use dot notation, by typing the object’s name, followed by a dot, followed by the name of the key (the string on the left of the : symbol).

For example,

var x = testObj.shoes;

will store the value "cleats" to the x variable.


#3

Thank you so much kevcomedia !!!