javascript question: functionName.VariableName?
<p>I had the following question in a test today. But i had not see something like functionName.VariableName before. Not sure how that works.</p>

<p>Would be great if you can tell me the solution:</p>

<pre><code>function Item(itemName)
{
    var next_item_id = 1;

    Item.item_name = itemName;
    Item.item_id = next_item_id++;
}

var Item1 = Item('Desktop');
var Item2 = Item('Laptop');
var Item3 = Item('Monitor');
</code></pre>

<ol>
<li>Anything wrong with the code above? if yes fix it. (The problem i would see is next_item_id is always 1, need to make it global?)</li>
<li>Modify the function so that the variable “next_item_id”, cannot be modified during run time.</li>
<li>My own question, how does the variable like Item.item_name work? I want to google it, but not sure what I should search for.</li>
</ol>

<p>Thanks.</p>
