Тёмный

What is Factory Function in JavaScript - in 1 minute 

ColorCode
Подписаться 82 тыс.
Просмотров 11 тыс.
50% 1

Factory Functions are an incredibly useful tool in JavaScript. It's a design pattern that's used in many languages. In this one minute coding video I will explain why they are useful, the problem they tend to solve, and a practical example. Enjoy!
#Shorts
=================
Sign up for an account on www.colorcode.io and watch full courses for free.

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@TheEpicNoodle
@TheEpicNoodle 3 года назад
Wow it felt so good just getting the run down of this - so many tutorial videos full of fluff but this is right to the point with a real world example! Thank you
@ColorCodeio
@ColorCodeio 3 года назад
Glad it helped!
@frostsmaker8966
@frostsmaker8966 3 года назад
I recommend you to make this kind of explanation, something short and concise is desirable by many people. :D
@ColorCodeio
@ColorCodeio 3 года назад
Thanks!
@JoaoVitor-pc4ps
@JoaoVitor-pc4ps 3 года назад
Your contents is helping me a lot! Thanks so much.
@ColorCodeio
@ColorCodeio 3 года назад
Happy to hear that!
@elianrc
@elianrc 3 года назад
This is amazing! Thanks for this kind of video!
@ColorCodeio
@ColorCodeio 3 года назад
Thank you
@mech-r4v
@mech-r4v 4 дня назад
You can just use class
@gpcgpc810
@gpcgpc810 Месяц назад
Thank you for the 1 minute version, it is nice.
@nabeelahmed1721
@nabeelahmed1721 3 года назад
Wow, I could see these being used to create a blockchain
@PatrikRasch
@PatrikRasch 2 года назад
Quality.
@yatin1370
@yatin1370 9 месяцев назад
This was hugely helpful, understood the concept better. Thanks.
@ColorCodeio
@ColorCodeio 9 месяцев назад
Great!
@jeckart3d
@jeckart3d 3 года назад
Is this something that we should do to refactor Em’s rainbow?! Also, happy to see a new 1-minute vid!
@ColorCodeio
@ColorCodeio 3 года назад
Thanks, man :) There's going to be room for refactoring for sure, but I don't know if this particular pattern applies unless she's writing JavaScript.
@jeckart3d
@jeckart3d 3 года назад
@@ColorCodeio ahhhh, alright. I had thought what she was doing was based on JavaScript but in a “kid-friendly” wrapper.
@ColorCodeio
@ColorCodeio 3 года назад
@@jeckart3d Yeah I remember there was an option to write actual JS or use the visualizer tool to make it easier. I wonder if there's a full JS engine behind that thing. Probably.🤷🏻‍♂️
@1Dshan
@1Dshan Год назад
I recently implemented a strategy pattern, for rendering cards on a page. The rendering logic was a little bit different for each card. Then I used a factory to instantiate the different strategies and pass the correct strategy too the view, worked really nicely
@mich_thedev
@mich_thedev Год назад
Nicely explained. Is that how react's jsx. Elements are made?
@HigkeyRegarded007
@HigkeyRegarded007 2 года назад
mind blown.
@ColorCodeio
@ColorCodeio 2 года назад
🤯
@killvapkillvaps3719
@killvapkillvaps3719 3 года назад
I 'm still confusing, why people use constructor functions if exists factory. Factory functions more flexible: it's not reqired 'this' and 'new' keywords, haven't privacy issues and don't have a problems with losing context with 'this' when we have a nested functions. Can you explain in which cases we should use 'constructor' ?
@ColorCodeio
@ColorCodeio 3 года назад
Yep, explaining that in episode 5.
@killvapkillvaps3719
@killvapkillvaps3719 3 года назад
@@ColorCodeio thanks, will waiting for new episode)
Далее
JavaScript Constructors in 1 minute #shorts
1:00
Просмотров 53 тыс.
What is Factory Function in JavaScript? - JS Tutorial
17:31
КАК БОМЖУ ЗАРАБОТАТЬ НА ТАЧКУ
1:36:32
Factory Functions in JavaScript
6:34
Просмотров 211 тыс.
10 Design Patterns Explained in 10 Minutes
11:04
Просмотров 2,3 млн
JavaScript Factory Functions and the Prototype
7:57
Просмотров 3,5 тыс.
JavaScript Closures Tutorial (Explained in depth)
19:03
Factory Functions - Design Patterns in JavaScript
8:05