As far as I understand the following statements are equal
- object.property
- object["property"]
So, I've been doing some testing and I can't figure out how to make dot notation work correctly for functionP.
I normally use a dump tool screendump somewhere on this page to see what's going on, but it doesn't show the properties for a function it seems.
Why can I do this
alert(functionE()); // returns key and date
alert(functionE.keyE); // returns key and date
function functionE()
{
var myKey = "keyE";
functionE[myKey] = myKey + " +++ " + Date();
return functionE[myKey];
}
But not this
alert(functionP()); // returns key and date
alert(functionP.keyP); // RETURNS UNDEFINED
function functionP()
{
var myKey = "keyP";
functionP.myKey = myKey + " +++ " + Date();
return functionP.myKey;
}
While I can do this
alert(functionT()); // returns key and date
alert(functionT.keyT); // returns key and date
function functionT()
{
functionT.keyT = "keyT" + " +++ " + Date();
return functionT.keyT;
}