Object Oriented JavaScript Tutorial #7 - Method Chaining

preview_player
Показать описание
Hey gang, in this Object Oriented JavaScript tutorial I'll explain what method chaining is, and how we can set this up to work by editing the return value of the methods inside our User class.

🐱‍💻 Course Links:

Рекомендации по теме
Комментарии
Автор

For those who are learning about method chaining for the first time: the UpdateScore function is not necessary to method chain userOne.login().logout() or any other variant. All you needed to add to your code (assuming you have the same code as the last video) is "return this;" under the two functions "login" and "logout" . Shaun simply added the function updateScore because he wanted to arbitrarily count starting from 0 each time the updateScore function is called. Hope that clears the air for any that are confused!

reillyodonnell
Автор

By far, my best 5 minutes in OOJS! Wow... just unlocks so much value, just like that, thanks, Ninja!

ke
Автор

Something about the way you explained it at the very end finally broke through to me, thank you so so much

Pathsfound
Автор

You are the prince of explaining development, thanks a lot

ahmedabdou
Автор

This series (past few videos) is the most excellent explanation of classes i've seen. And i've searched for good explanations a lot the last few days. So: a very big thank you!

envivomedia
Автор

Wow, I've been using method chaining this whole time and didn't realize how easy it is to implement yourself. Thanks for the great explanation!

jerryg
Автор

Hands down the best playlist for absolute beginners like me. Thanks a lot

sguha
Автор

return this on every method for chaining.. got it :)

el
Автор

Thanks. Learnt something new today coming from a Java backround. I did encounter this type of method usage a lot with the Java 8 Streams API but I never new how it was implemented and what it was called. This also made the Builder Pattern i was reading about ages ago make a lot more sense! Awesome video overall. Cheers.

vaelinalsorna
Автор

This was just the tutorial I needed to help me make classes for a discord bot I’m working on.

adamcope
Автор

you are one amazing ninja, the king of all ninjas , the ninja assassin ninja, the siddhartha gautama ninja ...Thank god people like you exist ! thank you.

chaoukimachreki
Автор

Its my Birthday ninja.... And you gave a Special Gift.. This Playlist.

legndtariq
Автор

Thank you so much Shaun!! i`m excited to see the rest, you cleared up so much

carltongordon
Автор

Thanks for the clear explanation. It took me a few minutes to realise what's happening. I was using -> let newUser, instead of -> var newUser. And it wasn't obviously working because of scope.

antonv
Автор

Honestly the most useful JS video for me thus far

qu
Автор

What a tutorial, So addictive. Hats off . Thank you

saurabhd
Автор

I am so grateful for these videos. Thank you so much 💗

lucianabacelar
Автор

JUST AMAZING! extremely simple and precise explanation of OOP in Javascript..cheers mate

srinivasmudda
Автор

awesome explanation i struggled to learn fo this topic at geeks fo geeks but this video was just outstanding 😘

talhaansari
Автор

Thanks for explaining this like I am 5. Really helpful :)

Yev