What is Factory Function in JavaScript - in 1 minute

preview_player
Показать описание
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

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

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

TheEpicNoodle
Автор

Thank you for the 1 minute version, it is nice.

gpcgpc
Автор

This was hugely helpful, understood the concept better. Thanks.

yatin
Автор

I recommend you to make this kind of explanation, something short and concise is desirable by many people. :D

frostsmaker
Автор

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

Dshan
Автор

Your contents is helping me a lot! Thanks so much.

JoaoVitor-pcps
Автор

This is amazing! Thanks for this kind of video!

elianrc
Автор

Is this something that we should do to refactor Em’s rainbow?! Also, happy to see a new 1-minute vid!

jeckartd
Автор

Nicely explained. Is that how react's jsx. Elements are made?

mich_thedev
Автор

Wow, I could see these being used to create a blockchain

nabeelahmed
Автор

Honestly insanely handsome. Can't get over it lol

nateizu
Автор

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' ?

killvapkillvaps
join shbcf.ru