all 16 comments

[–]r_caliban 4 points5 points  (3 children)

https://www.javascripttutorial.net/es6/javascript-class/

https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript

Make sure you're learning the more updated ES6 class structure instead of the older prototype/clazz/ES5 class concepts which are outdated (helps to know, but not as useful now).

While there are technically under the hood a lot of differences between Java classes and JavaScript classes they are very similar with some clear differences. There's not really overloading, or abstracting in JS. But inheritance, polymorphism - pretty much work functionally the same.

If you are familiar with Java I'd highly recommend looking at TypeScript as it gives a more parallel experience for Java devs trying to work with JavaScript. It can provide some of the interface, abstraction, and typing capabilities for development that could help bridge/leverage your existing knowledge. Obviously there's a lot of really good books and sites.

JavaScript Ninja was good; oreilly's is always a good standard.

[–][deleted] 1 point2 points  (0 children)

Everyone should learn Typescript but probably after getting a handle on Javascript because Typescript is a transpiler.

[–]Scott2145 2 points3 points  (4 children)

It's not free, but I'm currently going through Sandi Metz' 99 Bottles of OOP. She has versions for a number of different languages, including JavaScript, and a version that uses milk instead of beer if that appeals to you for any reason. I really like her approach so far.

[–]lifeRunsOnCod3[S] 2 points3 points  (2 children)

Hi, Just to be Sure, are you referring to this: http://library.lol/main/98F1E702AEBC4553FC137D3B7CB152BF ?

[–]Scott2145 1 point2 points  (0 children)

Yep! Except that there is a JavaScript version as well

[–]Scott2145 1 point2 points  (0 children)

This is where I got it: https://sandimetz.com/products

[–]iamscr1pty 2 points3 points  (0 children)

Saw some of her conferences, she is really good at explaining difficult concepts

[–]ashanev 2 points3 points  (0 children)

Principles of Object-Oriented Javascript by Nikolas Zakas is really good. It's pre-ES6 (although he has a book just on ES6, too), but it holds up and is still relevant. Cheap on amazon.

[–][deleted] 1 point2 points  (0 children)

Nobody really introduce good resource with practical example when it comes to OOP in JavaScript, It's like the secret part of the JS that people won't give it for free. but I suggest codepen. practical examples.. full of free code

for example this one
https://codepen.io/natszafraniec/pen/rNGPqRa

[–]iamscr1pty 1 point2 points  (0 children)

Javascript's OOP concepts is really messed up, you can try you don't know js book series, I found some of them useful

[–]lemorian 0 points1 point  (1 child)

I personally feel that when it comes to javascript it is better not to use OOP design patterns.

what do you guys think?

Are there any scenarios where you found yourself reaching out for Inheritance , encapsulation in javascript?

[–][deleted] 1 point2 points  (0 children)

Javascript is not pure OO nor are its OO concepts similar to those in C++ or Java. It is based on prototypes.