Need clarification on when to use quotes and when not to in JavaScript
<p>I'm new to JavaScript following the courses from codecademy.com.  Recently they introduced bracket notation (as opposed to the simpler dot notation).  I understand there are advantages because you can reference things that you can't reference using dot notation.  However I don't understand why I'm supposed to use quotes in certain circumstances.</p>

<p>For example:</p>

<pre><code>var suitcase = {
    shorts: "purple"
};
if (suitcase.hasOwnProperty("shorts")) {
    console.log(suitcase.shorts);
}
</code></pre>

<p>Why does shorts need quotes around it in the line <code>if (suitcase.hasOwnProperty("shorts")) {</code>?  I'm used to quotes designating something as a string.  shorts is a property of the suitcase object so I would think it would be referenced without quotes.  So far I've been doing well understanding the rules of JavaScript but this wasn't clearly explained so I find myself confused.</p>
