Lesson Code: http://www.developphp.com/video/JavaScript/Class-OOP-Tutorial-Intro-to-Object-Oriented-Programming
Introduction to creating class based code in JavaScript, also known as OOP(Object Oriented Programming). Because it is a class-less prototype-based language special syntax is applied to your JavaScript in order to achieve OOP features that we see in languages such as C++, C#, PHP, Java, Perl, Python and more. JavaScript has no class statement for establishing your classes like other popular languages do, but this does not mean that we cannot create class based code in JavaScript.
Original source
21 responses to “JavaScript Class OOP Tutorial Intro to Object Oriented Programming”
very good explanation thank you
Good job Adam, clear and concise. Also cool that you sound like Ray Liotta!
wonderful
From what I just learned in here: http://stackoverflow.com/questions/11970141/javascript-whats-the-difference-between-a-function-and-a-class, there is no such thing as a class in javascript, strictly speaking. What would you say to that?
I am about to attend an interview where I need to discuss OOP in Javascript I am a fan already of your excellent no nonsense approach to explaining this concept. Thanks and keep in rolling. I will look out for much more from you going forward. Keep up the great work
You are awesome!! Adam:)
thank you so much this video was so helpful god bless you sir thank you !!!
Doesn't javascript have a class option now?
WAW , THE BEST PROFESSOR
THANK YOU SO MUCH FOR THIS VIDEO
thanks brother..
you sound like h3h3
instascribe
Thanks bro, now i can start making some money with this
Very useful. Thanks 🙂
How about this variant without OOP:
function rotate(el, dir, d) {
d = d || 0;
// …. rest of your code here
setTimeout( function () { rotate(el, dir, d); }, 20);
}
in HTML all the same:
<script>
rotate("img1", "cw");
…
</script>
exactly the info I needed coming from a Java background!
you could just put the var d in the animate function for the same effect. I don't think the example is very good. As a java dev primarilly I know the usefulness of the pattern is encapsulation which makes the code clearer
Super helpful lesson. Thank you!
This is one of the most beautiful , strange at the same time weirdest use of flexibility of javascript I have seen .I could have never imagined that a function can be used as a class .
Thank you for this video it was very helpful. Your example of when and where to use OOP is very precise and useful information. One question. Is there an instance when you cannot achieve a certain result using OOP and having to use the original way of programming JS? So the other way around to the example you used?
Give this guy a medal.