What is the difference between appending and not appending ' ' to an object key in JavaScript?

Viewed 9

I created the following code.

var score = {'Lee' : 85, 'Kim' : 90, 'Ryu' : 75};

In this case, since the key is String, I used ' ', but it works safely even if I remove it like this:

var score = {Lee : 85, Kim : 90, Ryu : 75};

Is there any difference between these two methods? If so, I'd like to know what it is.

0 Answers
Related