4 ms·
> Inheritance A Class can inherit characteristics from another Class. Somebody should tell Mozilla, that there are no classes in JavaScript....
by voidr 15y ago
> Inheritance A Class can inherit characteristics from another Class.
Somebody should tell Mozilla, that there are no classes in JavaScript....
- sjs 15y agoPlease don't make us start saying "object used as a class".
- voidr 15y agoThe first step to learning JavaScript is to forget about class-ical OOP, you can't write good code if you start forcing class-ical concepts on JavaScript, it's a prototypical language encouraging people to treat it as something else is wrong.
- sjs 15y agoWhen a language has a deficiency people make up for it with libraries. If you don't acknowledge the "class pattern" for object inheritance then you are dismissing an incredibly popular use of OO. Whether or not code reuse via OO is a good thing or not is a whole other debate though. I don't try to warp every problem into a class hierarchy, but sometimes it's a useful conceptual tool.
- erez 15y agoThe guide says that immediately after the terminology paragraph
- johncoltrane 15y agoBut comes back to it at the Custom Objects part(1). And everywhere. They don't use "class" as a keyword, though, but more in a CS way which can be problematic because other keywords like "prototype", "array" or "object" mean pretty much the same thing in both contexts. An interesting ressource, anyway. (1) https://developer.mozilla.org/en/Introduction_to_Object-Oriented_JavaScript#Custom_Objects https://developer.mozilla.org/en/Introduction_to_Object-Orie...
- johncoltrane 15y agoThe document is probably targeted at newcomers from other languages. But still…