Static Methods in JavaScript Tutorial : Object Oriented Programming Series - Part 11
Вставка
- Опубліковано 18 вер 2017
- JavaScript Static Class Methods.
Article and code samples from this tutorial
* techsith.com\
Please be my patreons on patreaon
* / techsith
Follow me for technology updates
* / techsith
* / techsith1
Help me translate this video.
* ua-cam.com/users/timedtext_vide... - Наука та технологія
More I learn JS, more I realize I don't know JS.
That realization is very important so that you can learn JavaScript more.
More I learn JS, more I realize Python is way more reasonable :D
I've watched many of your videos now. I think you are one of my favorite UA-camrs. You break things down to bare metal and teach with pricision. Thank you.
Thanks for watching! :)
Finally! I was able to understand the static method in JS. Thanks, Sir! Awesome explanation.
This channel is one of the best
I really appreciate the video. You defined everything clearly and gave examples that helped me understand what static is and when to use it. Thank you!
That Object.assign shortcut... brilliant
Thanks a lot! You helped me understand static methods!
You are a very good teacher. Your videos are awesome.
Thanks for watching!:)
Really good explanation! Will be checking more videos from you.
I find your videos very useful. Well done.
auto subscribed for amazing explanation of this subject
Nice Videos . Very helpful
You seem to absorb topics well and also produce the content. Cheers brother
Thanks man...
techsith Tank you for this lesson!!!
Great explanation! Is it a good practise to have many static methods/properties if you dont need in the instance of the class ?
what is the use of static methods, apart from polluting your memory?
great! great! great!
really love your video. hope to have time to translate to hebrew for future ppl
Thank you very much for considering . Looking forward to the hebrew translation. :)
simplest explanation Just wow, can u please make video on Mobex, rxjs , javascript mostly used design patterns and subscribers observer
I do have a plan for Mobex videos and design patterns
nice
Why create a static method in the Car class vs. just a regular function in the global scope that does the same thing?
Defining something in global scope affects everything. Also if you have a class as a separate library. and you use it in a different project the static method will still be available base its part of the class.
your lectures are really helpful. Can u please create course on AngularJS
Thanks for watching :) I am working on agular JS series right now. I will have it ready in about 15 days.
Good morning, please ask the following question: can the class have a variable or a constant? For example let auto = Class Car {...}. is that correct?. Tanks for your answer.
hi Hemil, great video. thanks so much. i have a query. you say that static/class methods are like utility functions. what does that mean.. im basically trying to undrrstand why do we need these static classes... what is it that they are providing that we cant accomplish with instance classes.
think of them as usb charger in your car. its helps you charge your cell phone whil you are in the car. but its not require as a part of the function of running a car. It doesnt affect any driving functions. make sense?
techsith yes.. that analogy makes sense... so what wld be a practical usecase of static methods... also, are static methods just syntactic sugar... if so, what are these static methods under the hood... thanks
First of all they are not added to prototpye of the class like instance methods. and they are not available to instances. so they are bit unique in that sense.
Why DRY in repeating same static method sellCar() again in subclass? can't we just call it from superclass?
polymorphism
There's no playlist for this series. How am I supposed to find the first video?
ua-cam.com/play/PL7pEw9n3GkoW0ceMeoycg9D00YjPAbtvt.html
Hi Tech, could you please try to answer my question. I understand that this question isn't below to this video. But how can I make static audio frequencies in canvas using JS or React?
you want to create audio frequencies? like waves painted on canvas ?
@@Techsithtube yes, like in soundcloud but I don't want to use wavesurfer for this taks
Awesome,
let me:
1) static method can be call on class. - Toyota.sellCar
2) static method have object/instance as argument - Toyota.sellCar(camry)
3) static method don't have "this"
-Thank you.
Yes. you got it :)
Static method can have context bound to them and therefore have a "this".
console.log(`Toyota ${car.price}`); //because inside static method no 'this' or 'super'
vs
console.log(`Toyota ${super.price}`);
awesome lectures..when you are going to launch a course on udemy?
I am actually working on it. Might take few months for that.
techsith waiting for your course on udemy.
His course is available udemy
But, what's the point with the static method? Why should I set a method in the static way?
Static methods are used as utilities for classes.
It's super +1
thanks for watching! :)
sir
do you have a React course??/
I found it everywhere online but couldn't see it.
you might not have it
I am not sure.
you are freakin good good good good good instructor.
thannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnks
Yes I have the react course, its on my channel description .
I have a question please.
How to become a full Stack web developer? And JavaScript expert?
Full stack means (JavaScript + css + html ) + ( Back-end Expertise ). You have to pick on of the back-end languages like java, c++, python or node. I would suggest to go with node since its also JavaScript so bit easier.
techsith thanks brother.
You're JavaScript tutorials are awesome.
Love it 😍
Hit like if u figured out that it Shud be "car.price" instead of "this.price" and waiting for the error on console :P
this is wrong is class is existed in javascript
Yes, JavaScript has classes. Its been there for atleast few years, It was introduced in ES6. If you have used any modern JS framework you would have used classes.