paint-brush
Understanding JavaScript Prototypes and Its Methodsby@olgakiba
18,854 reads
18,854 reads

Understanding JavaScript Prototypes and Its Methods

by Olga Kiba8mOctober 17th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The factory pattern is a well-known design pattern used in software engineering to abstract away the process of creating specific objects. The Constructor Pattern is used to create specific types of objects in JavaScript. It solves the problem of having duplicate functions in the global scope but also creates clutter in the code. We can solve this problem as following: using the constructor pattern instead of the factory pattern to create multiple objects with the same interface. The pattern is extremely suboptimal in terms of memory allocation and power, because with such an entity description you will receive in each instance not a reference to the `getSpeedInfo()` method.

Company Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Understanding JavaScript Prototypes and Its Methods
Olga Kiba HackerNoon profile picture
Olga Kiba

Olga Kiba

@olgakiba

Love Chinese culture and coding

0-item

STORY’S CREDIBILITY

DYOR

DYOR

The writer is smart, but don't just like, take their word for it. #DoYourOwnResearch

L O A D I N G
. . . comments & more!

About Author

Olga Kiba HackerNoon profile picture
Olga Kiba@olgakiba
Love Chinese culture and coding

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite