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”
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";
}
}
var derek_banas = "awesome";
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
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.
is it necessary to write 'prototype' ?
what font is he using in that editor? I'd love to have it for windows and linux
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.
VERY glad understood it
Glad I went bald before learning method overloading in javascript. Great tut!
perfect as ever,
Thanks
just started JS a week ago, this stuff is amazing 🙂 im sad i started so late but you make it fun
100+ like!!!
this episode was really confusing ~_~
From the tutorial: mode -> mood? 🙂
i have tried, extend function can do fine without add temp function, then whats the purporse of the Empty Temp function?this rather confuse me~anyone can help?
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!
You have done an amazing job creating these … I follow each of ur videos… Kudos..If u could go lil more advance and practical application example will help a lot
This one is even better because you explain so well i learn all the syntax here!!
mood or mode ??
Excellent intro to OOP Javascript
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?
make a fortran tutorial. FORTRAN is awesome.
Hey Derek,
Are these tutorials still up to date with today? Just curious since they are over 4 years old haha…
Thank you! You're explanation of method overloading made a lot of sense.
Good tutorial! I just have one question, where we gonna used OO Javascript in real life?
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 ?
I don't know why, but at 10:48 the way you said those few things, really reminded me of Robert Downey Jr in iron man. 😀
Thanks for your great works!!!
Your tutorials are amazing.
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 ?
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?