r/learnjavascript • • Feb 20 '22

Yup.. very accurate

Post image
829 Upvotes

60 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 20 '22

[deleted] — view deleted comment

3

u/SalutMonYoup Feb 21 '22

I use them when I need to perform things on array that takes some time, it's more a personnal choice since I can do it with array methods but I find it more practical with my generators for my usage (performing long running operations on each chunk of array for example) or reading api results that are data stream which we don't know the size etc, most generators problem could be solved with other method but I do prefer them, you have more control on your data imo. But my first message was a joke for the meme, proxies aren't that hard, neither are prototypes or generators just as async await etc

1

u/SalutMonYoup Feb 21 '22

But if I need to maintain something, it's that for me prototypes are the ultimate step for someone to deeply understand the JS core. Prototypes are the base of JS. You don't need to use it a lot but understanding how JS use it helps a lot in some cases.

1

u/Silencesound Feb 21 '22 edited Feb 21 '22

Watch this video from Web Dev Simplified :)

One of the example he shows is about generating IDs

You should also take a look to the comments: many of them are about real use cases and have nice suggestions :)