Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32901
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: hasOwnProperty and property className |
| Date | Sun, 02 Apr 2017 00:39:41 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 56 |
| Message-ID | <1898070.irdbgypaU6@PointedEars.de> (permalink) |
| References | <obnrdm$158t$1@csiph.com> <XnsA74A7CF5916ADeejj99@194.109.6.166> <obobnk$1hpt$1@csiph.com> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1491086381 1301 eJwFwYEBwCAIA7CXFNo6zgGU/09YQtdWH4gChzO3i3Ci/PBs26HBpK1qpJ7w7rLPWS/CsusHGesRLA== (1 Apr 2017 22:39:41 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Sat, 1 Apr 2017 22:39:41 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-Face | %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v |
| X-NNTP-Posting-Host | eJwNwokRACEIBLCWQPksZ5eT/kvwJvEdGp0WHubzQ9aAbZyjPKWyYWSLrY+u93prShYcIon1ACuSEUU= |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== |
| Cancel-Lock | sha1:hZl7SFZC7G+qCRZTt+1da60glCE= |
| X-User-ID | eJwFwQkBACAIBLBKIMcXRwT6R3BTMbbnMDXo6grVcNhG9rZS4PJ1kmxMRo5jSFr0wKj26XFelATGicuPfENMFKs= |
| Xref | csiph.com comp.lang.javascript:32901 |
Show key headers only | View raw
Cezary Tomczyk wrote:
> […] Evertjan. wrote:
>> Cezary Tomczyk […] wrote […]:
>>> Just out of curiosity.
>>>
>>> Why document.body.hasOwnProperty('className') returns false?
>>>
>>> Property className does exists for object document.body object.
>>
>> hasOwnProperty()
>> is about Javascript-objects,
>> not about DOM-objects,
>> methinks.
>> […]
>
> Thanks.
For misinformation based on a jump to conclusion based on cluelessness?
> On MDN
>
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty
> documentation doesn't mentioned that specifically.
And there is no reason why it should.
> Just:
>
> "The hasOwnProperty() method returns a boolean indicating whether the
> object has the specified property."
That wording is not entirely correct or, IOW, it is ambiguous; a matter of
definition.
In ECMAScript wording, an object has a property if it has the property
itself (its *own* property) *or* inherits the property from another object
through the prototype chain. (The inheritance is implicit; if you attempt
to access a property of an object that does not have it as its own, lookup
proceeds along the prototype chain until an object that has that property as
its own or the end of the prototype chain is reached.)
And that is definitely _not_ what the has*Own*Property() method’s return
value indicates. I have clarified the wording in the article accordingly.
> That's why I was asking.
Too bad then that you have not read carefully the “Description” section of
the article (which clarified that even before my edit), and my explanation
in my other follow-up.
--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
hasOwnProperty and property className Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-04-01 11:20 +0200
Re: hasOwnProperty and property className "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-01 12:17 +0200
Re: hasOwnProperty and property className Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-04-01 15:59 +0200
Re: hasOwnProperty and property className "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-01 16:40 +0200
Re: hasOwnProperty and property className Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-02 00:39 +0200
Re: hasOwnProperty and property className Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-01 13:53 +0200
csiph-web