#teckiajay #ajaybudaniya #javascript
!!! factory function in javascript #57 !!!
Playlist Link - • JavaScript Complete Course Advance Level
In JavaScript, a factory function is a function that returns an object. It's called a factory function because it creates and returns a new object each time it's called, just like a factory creates and produces new products.
What is the difference between constructor function and factory function - A constructor function is another javascript pattern, that is very similar to factory functions. Though, unlike factory functions, constructor functions do not actually return an object. To create different objects with the same properties, we would need to use the keyword "new" and the keyword "this".
Why do factory functions - Factory functions Instead of using the new keyword to create an object, factory functions set up and return the new object when you call the function. They do not use the prototype, which incurs a performance penalty - but as a general rule, this penalty isn't significant unless you're creating thousands of objects.
Website - https://teckiajay.com
Instagram - / teckiajay
Discord Server - / discord
Telegram channel - https://t.me/tecki_ajay
Thanks For Watching !
keep It up !
In questa pagina del sito puoi guardare il video online factory function in javascript #57 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Tecki Ajay 10 febbraio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 15 volte e gli è piaciuto 0 spettatori. Buona visione!