Running the code below shows that class TFalse.val.hasOwnProperty('a')
=== false.
Why is that? Can I not use hasOwnProperty?
e.q. URI.schemes does not own its properties http, https etc.
It seems that property options does own its properties.
Should I use hasOwnProperty in this case? I use it in this way:
for (key in this.val)
{
if (this.val.hasOwnProperty(key))
{
//do something with this.val[key]
}
}
code:
var TFalse, TTrue;
TFalse = new Class(
{
val:
{
a: 0
},
initialize: function ()
{
console.log(this.val.hasOwnProperty('a'));
}
});