JavaScript ES6 - Iterators and Generators

preview_player
Показать описание
This video talks about ES6 generator functions, generators, the iterator protocol and flow control!
Рекомендации по теме
Комментарии
Автор

You clarify it a lot but still it seems like so complicated, and i can't seem to get what scenario these things can apply to. I gotta keep do more research on the Iterator, iterable and generator!

autopilot
Автор

Thanks, great example of embeded generator - makes things clearer for that one.

xamedow
Автор

simple and especially clear!! a really good first example!!!

Bradelff
Автор

yay finally an example thats understandable! must have seen a dozen examples where people wanna be clever and end up with something they barely understand themselves. I suppose the trick is remembering where they will help code the most.

Ultriix
Автор

nice video, just a thought intead of doing copy paste five times you can select the entire line and hit ::: Command + Shift + d

peripona
Автор

Your while loop/do while loop example was a bit off. Since using gen.next() in the loop condition brings you to the next iteration, the next value once you reach the loop body is undefined.

NBuLoU
Автор

Generators are awesome. I think they are borrowed from python. I recently used one to getNextPrimeNumber() where I didn't know the biggest prime number that would be needed.

peternjenga
Автор

but where i have to use it? no real-life examples :(

SergiySev
Автор

yield returns an iterator, not a generator please check it

rayapudinayudu
Автор

Not sure how to feel about this concept. From a purely functional standpoint it feels kind of... icky.

asdqwe
Автор

Good video but just breezes over things too quickly.

peterviglietta
Автор

Search youtube for 'vocal fry'

dontusehername
welcome to shbcf.ru