Mixins in JavaScript : Object Oriented Programming Series - Part 8
Вставка
- Опубліковано 21 сер 2017
- JavaScript mixins to achieve multiple inheritance. By borrowing methods from multiple mixins.
Article and code samples from this tutorial
* techsith.com/mixins-in-javascript
Please help me translate this in your native language. Thanks much :)
* ua-cam.com/users/timedtext_vide...
Please be my patreons on patreaon
* / techsith
Follow me for technology updates
* / techsith
* / techsith1 - Наука та технологія
I literally bust out into laughter when he ate the ice cream. 😂😂😂😂😂
:) I am glad that you found it funny.
I can relate hahaha
Loved the image of a flying, crying superman. 😂Great tutorial too, now I finally know what mixins are!
saw your all videos and let me tell you, you made all the concepts super easy to understand. please don't stop, you are doing a wonderful job.. keep it up. thank you
Thanks for watching!
11:15 "... and he can dodge bullets, like aliens" LOL :)
Thanks for a good video. I like that you keep your videos nice and short.
:) thanks for watching!
Great Tutorial! For the Object.assign(), alternatively, we could also use the spread syntax in Javascript to achieve the same functionality like this,
const jsEngineer = { ...jsSkill, ...engDegree }
Thanks for all your energy! :)
Your way of explaining complicated concepts are very easy to understand :) thanks for posting this video. Very useful.
Thanks man. :) Your videos helped me a lot in sharpening my skills
Thank you, the best js tutorial on UA-cam
Thank you for watching! :)
Thank you and keep going, you tutorials are amazing.
Amazing content,thank you so much Sir.
Thanks for the upload, great video as always!
Thanks for watching!
Awesome tutorial again 😊
thanks for great tutorials
You are the best in the internet
Thanks :)
Great examples.. clear and focus
Thanks for watching!
Damn dude great content! I've never watched any of your videos but just subscribed. Thanks!
Thanks for watching Frankie.
thank you so much, this explains it better.
Simple and great tutorial. Explained very well . Good job.
:) Thanks for watching!
i liked the way u chose names which will make us easy to remember the functionality..thanks.
My pleasure 😊 Thanks for watching!
thanks
amazing tutorials
nice tutorial good job
Hello) I would like to say Thank you and keep going, you tutorials are amazing.
THanks for watching Andriy :)
it is amazing
thanks
So clear
Excellent!!
Thanks for watching!
Thanks.
Great Video Sir please add more I am enjoying
Thanks for watching Supriyo. which tutorial you would like me to add?
awesome!
thank you alot :=)
That was good explanation
As explained in previous video, it only does shallow copy. Then how can we copy prototypes as well?
Without explicitly giving entry in assign function?
Object.assign(null,jsSkills,engDegree) should also do the same work, or not?
Will that empty object {} have a prototype?
How can one create an object without a prototype?
Hi, I thank you for all these tutorials cause they are masterpiece, they help me ny understanding javascript, but i just wondered if you can make one about encapsulation, arguments keyword and the ternary operator
God bless you
Sure I will create a video explaining that. I think that might be useful.
I'm from Taiwan. Thanks.
Looks like the decorator pattern. Doesn't it?
"Now he's flying and crying at the same time" Man, that Lex Luthor sure whoop his ass.
you were seeking someone's attention so i helped you by liking your comment
salade of Object.assign() :D i love it hahahaha good job man , good thing to enhance js intelligence .
Great
It would be interesting to compare this to class/extends.
class/extends is inheritance. object.assign is composition. Using mixins you can sort of achieve multiple inheritance. Class is single inheritance.
at 10:40, as we use closures redCar.isMoving() should be the way , redCar.drive().isMoving() is redundant. thank you
Sunil , this is mixin example , to show you some of the tricks. In actual use some of that would be redundant.
"All human cry, and he will cry too. ("Tell me, do you bleed?... You will.) " *changes name to Sith Lord*
:)
Can u please add some interesting examples of JavaScript post message?
Thank you for the tutorial, the pace is perfect and explaination is simple. But I have a question, for the second part, why the variable name(isFlying) can be the same as the function name(isFlying())? Wouldn't there wont be any confusion? For example when we return isFlying, it is returning the function itself? Another question can we use spread operator to achieve the same goal (I am worry about the variable is it by reference or by value)?
In this case on isFlying is a variable and other is a method of returning object. So its ok to have the same name. However, It make sense to have different name to avoid confusion. if variable is passed is a primitive types like number, string or boolean, its by value and objects are by ref.
@@Techsithtube Thank you for the reply, I understand.
Good smile , while having ice-cream , 😂😂😂
:)
6:53 "aah shit" 😂
Object.assign(me, {wantsIceCreamNow: true});
Console.log('Thank You for watching!');
how to write a factory function by using function and how to call object.assign and give values
Can you give me an example ?
Why did you return Object.assign() when you could just as easily return a new object?
Object.assign() actually returns a new Object. I think also performance wise its faster than using a constructors.
techsith awesome. Thanks for the reply. Your videos are so helpful! Hugely appreciate your effort.
love
Great.keep inspiring.
Thanks for watching!
techsith we can use spread method instead of object.assign.which is more reliable.why did you choose to go with object.assign
+sabareesh k you mean the spread operator?
techsith yes
again
this is a terrible tutorials
it is so amazing
Why "console.log(superman.fly().cry().isCrying().isFlying());" showing Uncaught TypeError: superman.fly(...).cry(...).isCrying(...).isFlying is not a function
Iscrying gives you boolean so you can't call isflying on that.
Superman's crying as he flies cuz' he wants more methods
Hi i wanna convert your video in hindi to help indian peoples in learning
I really appreciate , please do let me know once you convert it so I can share that info with my hindi audience. Thanks! :)
Create examples , thanks
Thanks for watching!
Object.assign({},techSithEnMixinsVideo,techSithHindiMixinsVideo)
Now you got me hungry too ! 👅