These are the best Javascript tutorials I have seen so far. Easy, concise, to the point and explained in an very logical way. Thank you! I'm a huge fan of your teaching method.
@NetNinja7 жыл бұрын
Thanks :D
@fusiondew2 жыл бұрын
I've learned a couple languages, and you've made javascript the easiest with your tutorials. you've accurately covered all programming fundamentals in 30 videos I'm impressed!
@vladirimus77317 жыл бұрын
You have a real talent with teaching.
@NetNinja7 жыл бұрын
Thanks :)
@vladirimus77317 жыл бұрын
Put your course on Udemy. You'll have plenty of clients.
@FireXFist5 жыл бұрын
@@NetNinja just found you in 2019. you do!
@oloruntomiojo94334 жыл бұрын
Found him in 2020. Thanks a lot man
@MaxJacobson18 жыл бұрын
This explained it better than my teacher did at school. Thank-you!
@caseyvandyke70515 жыл бұрын
That's cool. I didn't even know they taught JavaScript in school.
@vincecaruso64654 жыл бұрын
I agree with Thom... done quite a few in the last several weeks, this is the clearest and most easy to understand.
@pawpaaj8 жыл бұрын
This is really well explained, once I tried to learn constructor functions from a book and couldn't get it. I've learn it easily from this tutorial, I've found out that those functions are quite simple. I guess I don't have talent for learning from books or you're just a good teacher!
@joellim70107 жыл бұрын
simply the best explanation about constructor function i have ever seen in my life!
@CameronChardukian5 жыл бұрын
Watching this video helped me finally get close to fully understanding object creation and its purpose in Javscript. Thank you!
@tonchita917 жыл бұрын
I just noticed, after 30 videos how awesome the thumbnails are
@Mirzly6 жыл бұрын
This is the best lecture I've seen on Constructors ever.
@Alex.Shalda Жыл бұрын
8 years past, still great value 👍
@zacharyallenkravits27125 жыл бұрын
I understood the concept of constructors in JS but, for some reason, this video helped make the 'this' keyword click for me. Been struggling with 'this' lol. Thank you
@trups11trupti6 жыл бұрын
Excellent way of teaching difficult concepts into easy understanding way. It would be nice if you can add more concepts like call, apply, bind, arrow etc...with your excellent way of teaching. Please let me know if you have any tutorial on this or create new one.
@brian_ham5 жыл бұрын
The way u explained was very easy to understand. Thanks so much
@Bergamoism6 жыл бұрын
Again and again. When I don't understand a concept, I come here and (light bulb!) Great job Shaun!
@robinkartik63567 жыл бұрын
Like the way you teach Constructors.
@VadimRob8 жыл бұрын
Finally I understand constructor functions purpose! Thank you!
@kylemondina-6b5097 жыл бұрын
OMG THANK YOU SO MUCH FOR THIS VERY CLEAR EXPLANATION!!!!
@pastuh6 жыл бұрын
Thanks, easy to understand. Now its time to create A.I.
@it_jedi_onchill6 жыл бұрын
You're the best teacher in my live! I don't like teachers in Russia. You're my teacher #1!
@vashisthegde1926 жыл бұрын
Hey! Net Ninja, I did not understand the part where you deleted the basic definition of the object... how did it work even though you deleted the whole object definition? Great tutorials, by the way! Keep up the great work!
@binarycodec6 жыл бұрын
straight to the point. Thanks man!
@Andrea-lf3jq4 жыл бұрын
Thank God for this man
@andyp.65452 жыл бұрын
Konstrookta foonkshen is de veri bestest foonkshen in de wold!!!!
@Jono_19877 жыл бұрын
This and the previous video left me thinking, Why is it so difficult for other people to explain this in JavaScript!
@gianniprocida33322 жыл бұрын
Wow! Amazing content. Amazing KZbin Channel! Thank you
@manhill88334 жыл бұрын
Love how you hit the keyboard like Lars Ulrich hits the drums. Luckily you seem to have a more patient personality.
@NetNinja4 жыл бұрын
lol. I invested in a slient keyboard for my newer videos.
@kaypakaipa85597 жыл бұрын
wow this is beautiful teaching, thank you DR Ninja
@NetNinja7 жыл бұрын
Thanks :)
@daniel....8 жыл бұрын
You can actually start the constructor function without adding 'var': function Car(speed, driver) {
@Yohina19897 жыл бұрын
I was wondering if there was a difference between var Car = function() vs just doing function Car(){}
@TRIBISTHEGAWD6 жыл бұрын
You should always use the var keyword to declare variables. Why? Good coding practice should be enough of a reason in itself, but declaring a variable without the var keyword means it is declared in the global scope (a variable like this is called an "implied" global).
@ibrahim475 жыл бұрын
it's a good practice to demonstrate that functions in JS are actually objects !
@Shit8738 жыл бұрын
Nice tutorial man! What's the difference between a constructor and a regular function? Why and when would you use one over the other?
@aduonye5 жыл бұрын
Sir, how where you able to use your code editor and the console at the same time? I see you write your JavaScript in your code editor and see the result in your console. How did you do that? Thanks for the videos.
@The_Nova_Glow4 жыл бұрын
well done mate.
@hamzashabbir32652 жыл бұрын
hello sir, i have a question which is "what if a user wants to enter the values of time and maxspeed, so how we can make our site possible to do that?"
@rohansharma49716 жыл бұрын
so, is constructor functions similar to a normal function ? And the only difference is the usage of new keyword for constuctor function??
@yazidbustomi91158 жыл бұрын
thank you shaun, you're my real ninja!!! :D
@NetNinja8 жыл бұрын
Haha, thanks Yazid! :)
@Jack-CSАй бұрын
I understood (or thought I did) the previous "This" lesson. Why do we need to use "this" here, if the instances of Car all have different names, why do we need to tell the code it's this specific one we're working on. Is it not assumed by the fact each instance of the object has a different name? Surely when it assigns the attribute, it knows it's going to e.g myCar2, so why do I then need "this" within it? Brains melting lol
@pragun19936 жыл бұрын
Hi, this is a bit tricky. Initially what you said was that 'this' keyword refers to the object based on the context in which it is operating. So if 'this' is used inside an object like `var mycar ={ this.name='Audi'}` then 'this' refers to mycar object. But in the example provided 'Car' is defined as a function and not an object. So, what does 'this' refers to inside an function. And when you're writing `var mycar = new Car()`, technically it should return a value which you have not defined in the function. So, how do we get an 'object' returned?
@rudyNok2 жыл бұрын
I know right? Just a sidenote - functions in javascript are also objects. But the magic happens because of the keyword new. Here is what the keyword new does: 1. A new empty object is created and assigned to this. 2. The function body executes. Usually it modifies this, adds new properties to it. 3. The value of this is returned. So this in the constructor function doesn't refer to the function itself if you call said function with the keyword new. That's how I understand it.
@pragun19932 жыл бұрын
@@rudyNokYes. Thanks for replying. It's been quite some time. But i got to know this later when I read portions of 'You Don't Know JS'.
@tasnianishat31945 жыл бұрын
Net Ninja , can you tell me about the problem with constructor i read in somewhere. It said "The major downside to constructors is that methods are created once for each instance. like logDriver() of myCar1 and myCar2 looks same. but those methods are not the same instance of Function. so when i check it with alert (myCar1.drive == myCar2.drive); it gives false. but why it happens? and how to solve this ?
@vigneshsrinivasan96925 жыл бұрын
is it right to say that var Car is a class?
@jsnode20757 жыл бұрын
However you are way faster than the ninja man but I have one question, suppose, if I have to call 20 cars, so iI need to write 20 lines of codes for only calling the constructor, is there any ways to go for loops, if yes, then how?
@returnedfaith72546 жыл бұрын
It's not nice not to leave a comment when you have learned so much from this video.
@NetNinja6 жыл бұрын
Thanks :)
@chandravadhanaa39243 жыл бұрын
Defining a function, function Car(){ //some code } is exactly the same as var Car = function(){ //some code } Am I right?
@daksh67527 жыл бұрын
Can you please use the dark theme?
@federicocucinotta99777 жыл бұрын
Hi, I love your videos! But I had a question about this one. Isn't a constructor function the same as a class in this case? Thanks in advance!
@kaypakaipa85597 жыл бұрын
hi, I think A class is the encapsulation of the definition(name & template) & creation of an object, whereas the constructor seem to only be the definition of object. it is the template of an object, and the template itself isnt an object until called to be created. values are passed thru it and an instance is created. thats my understanding of it, but hey i might be wrong, still learning too,
@federicocucinotta99777 жыл бұрын
Thank you very much for your response, if you are correct then classes would make it easier for me to organize my code!
@siddhartharao84908 жыл бұрын
var a = { fun: function() { document.write("hell"); } What is the difference between a.fun() and document.write(a.fun())?
@alexschmidt43714 жыл бұрын
So constructor functions are similar to classes in other languages like C++ or Java!?!? You declare the class/constructor and then you can make as many objects as you like in the same syntax.
@asitprakash64455 жыл бұрын
the : used in constructor function was throwing me error but instead of : when i used = it was working perfect
@kiritokirigaya60657 жыл бұрын
I wrote the exact code and chrome keepsaying unexpected error on the this.maxspeed = maxspeed ; , i dont know why ! Why ?
@greencoder74196 жыл бұрын
Why do we need to do this.maxSpeed=maxSpeed inside the constructor function. Why can we no do maxSpeed=maxSpeed?
@grantseguisa8 ай бұрын
how did the speed got changed to 30? when the max speed was supposed to be 10? im quite confused
@grantseguisa8 ай бұрын
ohh nvm, it was from the first car my head boutta explode 🤯🤯🤯🤯
@vityachess2 жыл бұрын
Is this actual on 2022?
@hrishabhbairagi24208 жыл бұрын
THanks ninja :)
@admiralrohan8 жыл бұрын
Where the semicolon is necessary to end a statement in javascript?
@MrBradleydoering6 жыл бұрын
I'm getting an error when I try to save this exact code in brackets: ERROR: 'console' is not defined How can I fix this?
@AbdullahMahmoods6 жыл бұрын
go to bracket's extension manager. there go to the installed tab and find ESlint and disable it
@MakeRandomVids5 жыл бұрын
Why doesn't this work? I would assume this to work..: let Car = function(driver, maxSpeed) { driver: driver; maxSpeed: maxSpeed; // this.driver = driver; // this.maxSpeed = maxSpeed; };
@lardosian6 жыл бұрын
But Shaun you are James Bond, admit it...
@razzchaudhary91845 жыл бұрын
a constructor is just a function that create ???
@matthewmcfadden9334 жыл бұрын
It didn't work. It says Unexpected token 'var'
@jonnywilson3757 жыл бұрын
Isn't this a Factory Design Pattern?
@JurajPecháč6 жыл бұрын
JavaScript Factory Functions vs Constructor Functions vs Classes medium.com/javascript-scene/javascript-factory-functions-vs-constructor-functions-vs-classes-2f22ceddf33e
@ziadmohamed14166 жыл бұрын
I cant get it , why did you write [ this.maxSpeed = max speed ; ] can anyone can suggest me a video to watch to understand this, please
@matteuspittmann27206 жыл бұрын
hey man, i wasn't sure if you got this figured out or not. But basically since in a constructor function you are constructing a new object that will take parameters you set in the parenthesis. So you'll want to tie those parameters to the properties like so: var Car = function(maxSpeed, driver){ //this is the object name & the parameters it will take //the following steps bind the properties to the parameters for when you create a new instance (or a new kind of version of this object). tthis.maxSpeed = maxSpeed; this.driver = driver; this.drive = function(speed, time){ console.log(speed * time); }; this.logDriver = function(){ console.log("driver name is " + this.driver); }; }; // Since you bound Car's properties to the parameters, you can just enter in your custom values to those parameters. Thus creating a new instance looks like this: var ziadsCar = new Car(100, "Ziad");
@BKofficer235 жыл бұрын
Thanks Matt
@tomasmatusek62923 жыл бұрын
@@matteuspittmann2720 yes, but bro I had same problem, I understand him, necause if u see,,driver have name yes,and same max speed had value, question is, if i can from function called back name of driver, how i can called back maxSpeed, i try that little bit hack, but .. like make for maxspeed function, but it not working var Car = function(maxSpeed, driver){ this.maxSpeed=maxSpeed; this.driver = driver; this.drive = function(speed, time) { console.log(speed * time); }; this.logDriver = function(){ console.log("driver name is " + this.driver); }; this.maxSpeed = function (maxSpeed) { console.log( maxSpeed); }; } var myCar= new Car(70, "Tomas"); var myCar2 = new Car(170, "Maja"); myCar2.maxSpeed(); myCar2.logDriver(); Im not sure that somebady will answer me, if i see its 3year vidio yes, but even that,maybe somoene had same problem.
@tomasmatusek62923 жыл бұрын
problem solver: var Car = function(maxSpeed, driver){ this.maxSpeed=maxSpeed; this.driver = driver; this.drive = function(speed, time) { console.log(speed * time); }; this.logDriver = function(){ console.log("driver name is " + this.driver); }; this.maxSpeed2 = function () { console.log( "maximalni rychlost je "+ this.maxSpeed); }; } var myCar= new Car(70, "Tomas"); var myCar2 = new Car(170, "Maja"); myCar2.maxSpeed2(); myCar2.logDriver();
@kiritokirigaya60657 жыл бұрын
Im a bit confused
@aidengrant36336 ай бұрын
Doesn't make sense to me, syntactically I mean. Car should be a function, and this must be referring to the parent object that the function resides in. This is one of the most bonkers syntax I've seen in JS, it's just too arbitrary and against convention.
@realcconnect68734 жыл бұрын
nothing I understand, uhhhh, very bad, even there is no source code
@sayedhasancp6 жыл бұрын
bad tutorial.................... not well explained...... just made with the little bit of basic..............
@shoummorauth7 жыл бұрын
Bro I am facing a problem. The problem is the starting sound of your videos is so annoying! and I don't want to skip any part of the video because it's distracting. Also, if any old guy want to start learning from your video then I don't know what's gonna happen...