Path: csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news.mb-net.net!open-news-network.org!.POSTED.32.229.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Not understanding OOP stuff Date: Sun, 23 Jul 2017 18:12:10 +0200 Organization: PointedEars Software (PES) Lines: 33 Message-ID: <1914438.irdbgypaU6@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="32.229.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch:178.197.229.32"; logging-data="2092"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 Cancel-Lock: sha1:y4jmHtAYGwdvzteA4e1DaAPCnEE= X-User-ID: U2FsdGVkX19IeNvUbrLl192FzV38iYleXlzTrj4+ZUTy4fp9aOj/7Q== 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== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. bit-naughty@hotmail.com writes: >> Is "addEventListener" INSIDE it or something? How is that possible? > > Yes. N-O. > Objects can contain methods. N-O. Objects *in ECMAScript implementations* can have *properties* whose value is a reference to a callable object; those are called “methods”. But this object does not even have such a property; it *inherits* it from another object, its prototype (or the prototype of that, depending on the DOM implementation). The main reason for that is reusability and consistency; objects that have the same object as their prototype can make use of the same method, and as the method implements a specific algorithm, of the same algorithm. This allows them to perform equal or at least similar functions. > (At least, this is the common metaphor.) Programming is _not_ philosophy. You would be well-advised to not speak in metaphors with regard to programming, but to learn and utilize precise terminology as well as the basic concepts of these programming languages before you attempt to teach them. Probably someone has told you this before. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.