#3 create sequential IDs generator | JavaScript tip and trick #short

preview_player
Показать описание
With generators being introduced in ES6, generating infinite, non-repeatable sequences has never been easier!
If you don’t know what generators are, they are functions that employ lazy evaluation by making use of the yield keyword to process and return data, on-demand.
It may look like generator functions will burn CPU cycles in an infinite loop, however, generators describe a state machine, allowing transitions to forward states to occur through provided code (through subsequent yields). These transitions occur on-demand whenever the next method is called, hence the term lazy evaluation!

youtube Link:

#js #jquery #javascript #react
Рекомендации по теме