What is Factory Function in JavaScript - in 1 minute

What is Factory Function in JavaScript - in 1 minute

ColorCode

3 года назад

10,457 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Duddits
Duddits - 02.03.2023 12:17

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

Ответить
Charles Ikechukwu
Charles Ikechukwu - 09.01.2023 18:04

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

Ответить
Patrik Rasch
Patrik Rasch - 25.07.2022 12:30

Quality.

Ответить
BaronVonBaron
BaronVonBaron - 15.07.2022 21:27

mind blown.

Ответить
João Vitor
João Vitor - 19.08.2021 01:28

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

Ответить
Killvap Killvaps
Killvap Killvaps - 14.05.2021 19:15

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

Ответить
Elian RC
Elian RC - 28.04.2021 16:21

This is amazing! Thanks for this kind of video!

Ответить
MWR
MWR - 22.04.2021 13:07

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

Ответить
Jay Eckert
Jay Eckert - 03.02.2021 00:09

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

Ответить
frosts maker
frosts maker - 02.02.2021 18:15

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

Ответить
Nabeel Ahmed
Nabeel Ahmed - 02.02.2021 17:42

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

Ответить