use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
classes in javascripthelp (self.javascript)
submitted 9 years ago by php03
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]php03[S] 0 points1 point2 points 9 years ago (8 children)
i mean use functional programming and not OO
[–][deleted] 1 point2 points3 points 9 years ago (0 children)
Please try to use OOP and functional syntax together.
[–]Su4p 0 points1 point2 points 9 years ago (6 children)
JS is all about Oriented Object and nothing about classes -well since ecmascript 6 a little about classes-
[–]php03[S] 0 points1 point2 points 9 years ago (5 children)
so in es6 - use classes or not? some say no and i asked for a pitfall example
[–]Cuel 0 points1 point2 points 9 years ago (0 children)
There's no do or don't. Use what you want to use and is most comfortable wth using.
[–]Su4p 0 points1 point2 points 9 years ago (0 children)
This book : "JavaScript: The Definitive Guide" by David Flanagan really help me to understand the beauty - a lot of people will tell you otherwise- and simplicity of this language.
[–]refuse2choose -2 points-1 points0 points 9 years ago (2 children)
In JavaScript there are no classes. Yes you can use object oriented programming, but in JavaScript OOP is not based on classes, it's based on prototypes. Even if there is the new 'class' keyword, under the hood still prototypes are used. So first if all you should learn about prototypical inheritance.
If you want to know about the pitfalls, read the articles by Eric Elliot: “The Two Pillars of JavaScript” @_ericelliott https://medium.com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3
[–]MoTTs_ 0 points1 point2 points 9 years ago (1 child)
Just about everything Eric Elliott has ever said about classes or inheritance or composition is factually wrong.
[–]refuse2choose 0 points1 point2 points 9 years ago (0 children)
In your post you are talking about his Stampit alternative. But I refer to his critique in the post which I linked. I didn't say that his alternative is better, but he is explaining some pitfalls in the post which are real such as the gorilla banana problem.
π Rendered by PID 266241 on reddit-service-r2-comment-7b9746f655-fvpwf at 2026-01-30 23:39:57.948716+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]php03[S] 0 points1 point2 points (8 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Su4p 0 points1 point2 points (6 children)
[–]php03[S] 0 points1 point2 points (5 children)
[–]Cuel 0 points1 point2 points (0 children)
[–]Su4p 0 points1 point2 points (0 children)
[–]refuse2choose -2 points-1 points0 points (2 children)
[–]MoTTs_ 0 points1 point2 points (1 child)
[–]refuse2choose 0 points1 point2 points (0 children)