I guess TFalse.val //undefined TFalse.prototype.val //defined
? On Tue, Aug 25, 2009 at 10:03 AM, woomla <[email protected]> wrote: > > 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')); > } > }); > > -- http://tbela99.blogspot.com/ fax : (+33) 08 26 51 94 51
