I can say one of the best videos on Java script ,key is ,you explain in simple terms not going by books .Please do more and help the community out there .My likes are for closures and promises :-)
Thank you for your great videos! I would like to see a course from you about design patterns like the observer, singleton patterns and generaly how to structure efficiently and DRY an application by real world examples in react or vanilla js! Greetings from Greece!
great explanation. just one thing: 10:55 there is no dependency between yields, it won't wait untill first is finished - it resume executing in case continuing calling of next()
please put this video after iterators tutorial in advanced javascript tutorial; also your channel is awesome, it covers a lot of things I was looking for after going from absolute basics to more advanced things - you explain them really straightforwardly iterators and generators might be just what I was looking for - I've got reocurring problem with iterate through arrays using for loop, and getting expected value after every iteration (not just when value of "i" reaches it's limit) - I have to write function for every case.
Thanks! very useful! btw, why can I use "let iterator = i.Symbol.iterator()" and have to use let iterator = i[Symbol.iterator]() it gives error "VM257:1 Uncaught TypeError: Cannot read property 'iterator' of undefined at :1:24"
It's been 2 weeks, but I hope it's still useful. "i.Symbol.iterator()" will first try to find 'i.Symbol'. It's the same as saying 'i["Symbol"]'. This doesn't exist, so it gives you 'undefined'. Then it tries to call 'iterator()' on that 'undefined' and fails. You can see now how 'i["Symbol"]' uses a different key from 'i[Symbol.iterator]'; the first is a String object, the second is a Symbol object.
Hi, your videos are very useful. I got corrected with the navigation menu issues. Thanks for your reply. Can you post some video for google map placing in a website javascript code?
Thanks. I wanted to learn Iterators and Generators so I could use Mongorito which makes extensive use of yield statements in its API. As an added bonus, I now know how to make my code cleaner with Generators.
I have a doubt in generator example using promise : For this specific example of generator with promise, it seems i can do the such dependent url calls using only promise so that 2nd url call will happen until first finishes and use 1st url data in 2nd, so why do we use generator here ? Please correct me if i am wrong. Thanks for such excellent tutorials !
Hi Sir, For the last example you gave: function *generator(){ yield request('url1'); yield request('url2'); } This is an easier version for .then callback? Are there any differences between using .then and this method? Thank you for your video!!
Well it can be a good replacement however. combing both together would get you async await. I am sure you must have heard of it. Its combination of generators and promises that makes async code looks like sync code.
Pretty late here but surely React first. Lower learning curve + Getting better at vanilla Javascript + Massive job opportunities. It's really a no-brainer. You can learn Angular after that.
Cool. This is how I can pipe multiple REST api calls, say sequencially, when there is a data dependency under a generator and call it from my GUI. (Poor peoples redux middleware😭). 🙏
Hi, thanks for your tutorial, but I have one question. This generators practical example with promises... why should I use generators instead of .then in Promises. It works the same :). Regards!
the idea is to make 2nd url request call after first call (promise) resolve. with generator you only need to call .next() after first call success / resolved. will help a lot if the generator is in separate file / class
I can say one of the best videos on Java script ,key is ,you explain in simple terms not going by books .Please do more and help the community out there .My likes are for closures and promises :-)
Thanks for watching Karthik
Thank you so much for your tutorials. Came for the memes, stayed for the dreams.
Excellently explained... Just looking for... Thank you very much sir :)
You are most welcome. thanks for watching!
Nice and clean. Great video, thank you
Impressed and subscribed just after this one.
Thanks for subscribing!
@@Techsithtube you won't go out of list never ever ever ever ever... 😋
Thanks for the wonderful explanation.
as always, great video!
Here from Redux Saga tutorial. Your videos are short and help me revise the concept. Good work sir 👍
Dude thumbnail is sickkkkk!!!!!!!
Thank you for your great videos! I would like to see a course from you about design patterns like the observer, singleton patterns and generaly how to structure efficiently and DRY an application by real world examples in react or vanilla js! Greetings from Greece!
you are great teacher, thanks for making more familiar with your easy explanation :)
awesome content!!!!
Hi TechSith....I just want to say...I love watching your tutorials...very nice explanation with real-time example... really it's helping us a lot....
Keep Learning and Thanks for watching!
great explanation. just one thing: 10:55 there is no dependency between yields, it won't wait untill first is finished - it resume executing in case continuing calling of next()
Correct there is no dependency if you run 2 next() back to back both two request will be sent and won't wait for each others' responses
nice info
thanks, nicely explained
Very well explained, thank you!
You explain this perfect! going to use it in Israel to explain my students and also giving your videos!!
@techsith: Awesome! thank you for the video.
thanks for watching :)
Where has this guy been all my life?
please put this video after iterators tutorial in advanced javascript tutorial;
also your channel is awesome, it covers a lot of things I was looking for after going from absolute basics to more advanced things - you explain them really straightforwardly
iterators and generators might be just what I was looking for - I've got
reocurring problem with iterate through arrays using for loop, and getting
expected value after every iteration (not just when value of "i" reaches
it's limit) - I have to write function for every case.
Great work. Thank you so much. :)
Akshay, thanks for watching!
Very nice !👍
Thanks for tutorials
Thanks! very useful!
btw, why can I use "let iterator = i.Symbol.iterator()" and have to use let iterator = i[Symbol.iterator]()
it gives error "VM257:1 Uncaught TypeError: Cannot read property 'iterator' of undefined
at :1:24"
same question
It's been 2 weeks, but I hope it's still useful.
"i.Symbol.iterator()" will first try to find 'i.Symbol'. It's the same as saying 'i["Symbol"]'. This doesn't exist, so it gives you 'undefined'.
Then it tries to call 'iterator()' on that 'undefined' and fails.
You can see now how 'i["Symbol"]' uses a different key from 'i[Symbol.iterator]'; the first is a String object, the second is a Symbol object.
Dalendrion U R THE MAN ty
Дмитрий Сухарев No problem, man.
Hi, your videos are very useful.
I got corrected with the navigation menu issues.
Thanks for your reply. Can you post some video for google map placing in a website javascript code?
awesome videos man, thanks!!
keep up the good work :)
Really awesome
Thanks. I wanted to learn Iterators and Generators so I could use Mongorito which makes extensive use of yield statements in its API.
As an added bonus, I now know how to make my code cleaner with Generators.
this guy is awesome.
great tuto
Great, thank you!
Beautiful
Could you also illustrate on passing an argument into the generator function via ".next(argument)"? I am very confused about this.
excellent
Thanks for watching!
Sir, It means, request(url1) and request(url2) is working in a synchronous manner, blocking approach of execution? Please explain
nice
We can do same with promises using async await then what is the difference?
Async await is nothing but mix of promises and generators.
Where we can use this?
Thanks
I have a doubt in generator example using promise : For this specific example of generator with promise, it seems i can do the such dependent url calls using only promise so that 2nd url call will happen until first finishes and use 1st url data in 2nd, so why do we use generator here ? Please correct me if i am wrong. Thanks for such excellent tutorials !
Lets say if you want to cancel a promise , using generators you can do it.
Hello @techsith, could you provide an example of this case. I did not find anyone . this interest me very much :s
Hi Sir,
For the last example you gave:
function *generator(){
yield request('url1');
yield request('url2');
}
This is an easier version for .then callback? Are there any differences between using .then and this method? Thank you for your video!!
Well it can be a good replacement however. combing both together would get you async await. I am sure you must have heard of it. Its combination of generators and promises that makes async code looks like sync code.
should I learn Angular2 or React?!! I'm so torn, help!
Pretty late here but surely React first. Lower learning curve + Getting better at vanilla Javascript + Massive job opportunities.
It's really a no-brainer.
You can learn Angular after that.
Cool. This is how I can pipe multiple REST api calls, say sequencially, when there is a data dependency under a generator and call it from my GUI. (Poor peoples redux middleware😭). 🙏
Hi, thanks for your tutorial, but I have one question. This generators practical example with promises... why should I use generators instead of .then in Promises. It works the same :).
Regards!
the idea is to make 2nd url request call after first call (promise) resolve. with generator you only need to call .next() after first call success / resolved. will help a lot if the generator is in separate file / class
Thx
Why not use await instead of yield? I don't get why use this.
Generators was used before async/await. I think async/await uses generators under the hood.
Love your thumb nails
if I call generator().next(); instead of iterator.next(); the value is always 1. Could you please make me understand?
Vishwa, generator() a new Iterator every time that is why generator().next() gives you 1 which is the first value.
@@Techsithtube thank you so much 🙏🏻
let iterator = i [ Symbol.iterator ]() ;
why wrapping Symbol.iterator within third brackets [ ] ?
becase by ecma definition iterators are accessed like thisArray.prototype[@@iterator]()
Why can't I just do this?
let iterator = i[Symbol.iterator]().next() //this just stays at array[0]
Instead of console.log(iterator.next()) everytime?
You could its perfectly file. However , every time you call next it has todo i[Symbol.iterator]() which is little bit expensive computation wise.
gj
apri