0

Is there class defination in JavaSecript

19th Feb 2017, 1:53 PM
Abdulhameed Alhababi
Abdulhameed Alhababi - avatar
6 Answers
+ 3
Last versions of ECMA script ( on which is based JS ), introduce syntaxic sugar to handle more easily classes concept through protypage one of JS... Unfortunally, this must be reserved for very specifics project, wich doesn't require cross-browser compatibility, as each doesn't implement these last features of JS ^^ Anyway, to dive deeper into that stuff: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
19th Feb 2017, 8:17 PM
visph
visph - avatar
+ 2
Watch this video: https://www.youtube.com/watch?v=O8wwnhdkPE4&t=2524s . Maybe it help you. And try other videos of this guy.
19th Feb 2017, 3:34 PM
Yurii Zadorozhnyi
Yurii Zadorozhnyi - avatar
+ 2
I will see the video thank you
19th Feb 2017, 3:42 PM
Abdulhameed Alhababi
Abdulhameed Alhababi - avatar
+ 1
In JavaScript there are no classes. Although the function to some extent fulfill their role. For example: function MyClass () {} ; var myObject = new MyClass(); alert(myObject instanceof MyClass); // true Try it.
19th Feb 2017, 3:03 PM
Yurii Zadorozhnyi
Yurii Zadorozhnyi - avatar
+ 1
I repeat "In JavaScript there are no classes." function MyClass () {} ; - you can think about it like it a class. var myObject = new MyClass(); - we create object (instance of "class" MyClass). alert(myObject instanceof MyClass); // true - check is myObject is instance of "class" MyClass. It is a long conversation about classes and OOP in JS. Watch videos read articles and you inevitably understand this things.
19th Feb 2017, 3:30 PM
Yurii Zadorozhnyi
Yurii Zadorozhnyi - avatar
0
please I want to understand how to use OOP with out class? What is the way in java script to create class?
19th Feb 2017, 3:08 PM
Abdulhameed Alhababi
Abdulhameed Alhababi - avatar