JavaScript Video Tutorial Pt 3




Best JavaScript Book : http://goo.gl/zodRHD

In this JavaScript Video Tutorial I will completely cover JavaScript Object Oriented Programming : Objects, Classes, Properties, Methods, Prototype, Encapsulation, Inheritance, Constructors, Method Overloading, Polymorphism.

Code is Here: http://bit.ly/e7K6RN

Original source


31 responses to “JavaScript Video Tutorial Pt 3”

  1. document.write…… shows as a syntax error in Dreamweaver? and i followed the tutorial but cant see anything in my browser it's totally blank??????

    Animal.prototype.setOwner = function(newOwner)
    {
    if (typeof newOwner != 'undefined')
    { this.owner = newOwner;
    }
    else
    {
    document.write("Please enter a valid owner";
    }
    }

  2. Hi! I am new to JavaScript with no real coding experience, what are the best places to go learn it for cheap or free? I am currently doing some code academy and I know treehouse is good, recommend any others? I want to learn as much as possible as quickly and well as I can

  3. At 9:40 you say that if you didn't instantiate Cat as a new Animal, that the object Cat would become a subclass of Animal. But how can that be if you need to define the new constructor in order to make the Animal the superclass? Wouldn't that make it a subclass anyway, and wouldn't it be constructor therefor not be necessary?

    I hope I'm not overthinking something you may have said in passing =P but it sounds like something that might be interesting to learn about inheritance.

    P.S. Amazing guides. Will recommend your guides to everyone, even random people I meet on the street.

  4. OOP is so weird in JavaScript. I have been doing Java for a few months and this is completely different. It's almost as if OOP wasn't an originally intended feature but was just dropped in later.

  5. If ES5 can do fine in OOP with its own style,why should ES6 mimic Other OOP language?won,t it be fine to be just what is?I think ES6 just add too many useless into a rather clear cut language!

  6. What is the point of inheriting all the methods and proprieteis with the call method when also you can do the same with the Cat.prototype = new Animal(); ? doesn't the Cat.prototype = new Animal() inherit all the methods and proprities from the super class Animal and set it as a subclass of Animal?

  7. Hi. Thanks for your great work! Just a quick question. Are the properties truly encapsulated as there doesn't seem to be a way to declare them as private which means you could just say dog.owner = "some value" which bypasses any error checking in your setter methods… is there a way to stop this direct access ?

  8. hey these videos really helped, thanks! JavaScript is used for other purposes also(like desktop widgets) and not only for web based activities so is the implementation there same ?

  9. Another great tutorial! Thanks. this is really a clear explanation of OOP in js. I got 2 questions: 1) instead of creating var dog = new Animal(), just we can do it like this: Dog.prototype = new Animal(); //so Dog is a subclass of the class Animal 
    2) I think we can use the method call to inherit any other class/objects methods e.g.:
     Dog.setName.call(Animal, "name"); is that possible?

Leave a Reply