When you call property in object, when to use the quotation marks?

Tell us what’s happening:

Hi everyone,
for this challenge, I don’t understand why when use dot notation, I can’t use quotation marks (for example, var hatValue=testObj.“hat”) . Even though the property was described as “hat”, why couldn’t I use “” when I try to call it?

And why in the bracket case, however, you are required to use the quotation mark to call a property?

Thanks anyone who could help.

Your code so far
// Setup
var testObj = {
“hat”: “ballcap”,
“shirt”: “jersey”,
“shoes”: “cleats”
};

// Only change code below this line

var hatValue = testObj.“hat”; // Change this line
var shirtValue = testObj.“shirt”; // Change this line


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

// Only change code below this line

var hatValue = testObj."hat";      // Change this line
var shirtValue = testObj."shirt";    // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36.

Challenge: Accessing Object Properties with Dot Notation

Link to the challenge:

Quotation marks are used to denote the beginning and end of a string. Just like when you’re reading a book you know that

she said “Hello”

wouldn’t be read aloud as

she said quote hello endquote

when coding instructions say

use the property “hello”

it doesn’t mean that you should do

thing.“hello”