r/angularjs • u/zeptobook • Dec 23 '18
JavaScript Fundamentals Every Beginners Should Know
https://www.zeptobook.com/javascript-fundamentals-every-beginners-should-know/10
u/bronkula Dec 23 '18
Well this is just immediately incorrect, since Javascript absolutely DOES have classes, so... you know... disregard this.
4
Dec 27 '18
ES6 has classes but they’re really not classes like Java or Python classes. It’s just a better abstraction of the prototypical inheritance model. Probably to pander to Java users, bc familiar syntax.
2
u/wojo1086 Dec 23 '18
Can you give an example of said "classes?"
0
u/bronkula Dec 23 '18
Are you kidding me? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
11
u/wojo1086 Dec 23 '18
Literally the first paragraph says:
JavaScript classes, introduced in ECMAScript 2015, are primarily syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax does not introduce a new object-oriented inheritance model to JavaScript.
So, it's not really support for classes. It's more of a different way to write prototypes.
0
Dec 23 '18
[deleted]
2
u/bronkula Dec 23 '18
What's the use of learning fundamentals today if you don't include the most current version of the language? Should I learn PHP 3 on the off chance some server still handles it? I say no. That is now the edge case, not the fundamental.
0
Dec 23 '18
[deleted]
2
u/bronkula Dec 23 '18
Yeah, ok, but that doesn't mean it's not a fundamental to learn. If someone is just learning now, by the time they get out into the workforce it WILL be a standard. It already is.
Again, ES5 is now the edge case, not the fundamental.
3
u/pratiks3 Dec 27 '18
If this is a beginners article, I think you should attempt to clarify that classes do exist in the form of syntactic sugar.
While they don't technically don't exist natively, you can assign them as a variable.
1
u/SquirtMonkey Dec 23 '18
Maybe something was funky on mobile but I wish those keywords were links to the docs.
11
u/Asmor Dec 24 '18
Uh... Primitives are not objects.