Fun with ES2015 Custom Iterators

  Рет қаралды 6,472

Colt Steele

Colt Steele

Күн бұрын

Пікірлер: 38
@bikabas
@bikabas 5 жыл бұрын
Thanks a lot Colt for the video. I believe the sequence is gradually building up to how async await work under the hood with help of generators. Would love to have you cover this topic. If it's in your cards , cant wait to see it.
@sonukr2284
@sonukr2284 5 жыл бұрын
You are Awesome teacher Colt. //From India
@meijboomm
@meijboomm 5 жыл бұрын
Why comment from India out? lol
@patrickren7395
@patrickren7395 5 жыл бұрын
this is so cool, got the same feeling I realised I can do operator overloading in C++
@russaanderson
@russaanderson 5 жыл бұрын
As always, good stuff - many thanks!
@yapayzeka
@yapayzeka 3 жыл бұрын
one of the best explanations out there. thank you sir
@Luxcium
@Luxcium 5 жыл бұрын
Wow 😮 you always find the most interesting things about JavaScript I like that... I was watching stuff about Iterable protocol one hour ago and then thought the KZfaq algo was amazing 😉 but it’s you who are amazing at finding interesting subjects 😄
@yuhceeofficial
@yuhceeofficial 5 жыл бұрын
Thanks Colt. Your number one fan here.
@s1n7ax
@s1n7ax 5 жыл бұрын
These tutorials are perfect.
@DiegoStiehl
@DiegoStiehl 4 жыл бұрын
Woow. That's so clear now. Very good. =D
@theprakashkumar
@theprakashkumar 5 жыл бұрын
How do you make and maintain notes for yourself.
@evenaicantfigurethisout
@evenaicantfigurethisout 5 жыл бұрын
Can you please cover streams next? (No pun intended ;)
@samarth2808
@samarth2808 5 жыл бұрын
Nice! I like the dark theme :)
@jatin_nagar
@jatin_nagar 5 жыл бұрын
Colt can you please add webcam videos in future videos?! I love watching you teach. Anyway, thanks for these awesome videos.
@sourishdutta9600
@sourishdutta9600 5 жыл бұрын
Very informative!! Thanks , need more videos like this.Can you please upload video on Microfrontend and Functional programming in js.
@user-zb5jp4ti1d
@user-zb5jp4ti1d 3 жыл бұрын
So good... just soo good
@Mitsunee_
@Mitsunee_ 5 жыл бұрын
It would probably be good to point out for the range() example that you need to put checks in place before returning the object including next(), to make sure the arguments are all numeric, convert them from string to number if required, and make sure that end is greater than start unless step is negative in which case end needs to be smaller than start. Without those checks infinite loops are easily possible or at best you get a technically incorrect result including at least one step, that shouldn't be there.
@bripowered
@bripowered 5 жыл бұрын
thanks, Colt!
@willadams6217
@willadams6217 5 жыл бұрын
I'm predicting a generators video coming up soon....
@danielsharp2402
@danielsharp2402 5 жыл бұрын
A thing I'd like to point out is that the current state should definetely not be a part of the range function but rather the [Symbol.iterator] otherwise. const myRange range(0, 10, 5); [...myRange] => [0, 5, 10] [...myRange] => [] as the current is already 10
@evenaicantfigurethisout
@evenaicantfigurethisout 5 жыл бұрын
Is "done" a JS reserved keyword? That's why it knows to stop iterating right? Also is "value" also a reserved keyword? Edit: I think I get it now. It's not so much that done and value are reserved keywords. It's that the spread operator has been hardcoded to look for these keywords to tell it what to output and when to stop. That sounds about right?
@Luxcium
@Luxcium 5 жыл бұрын
KL Tah they are defined by the protocols so it’s not a reserved keyword or something but it’s what JS is expecting by definition ... on the other hand the symbol.iterator instead of being a “Keyword” per say is called a well known symbol ... We can have not only custom but as well built in symbols representing internal language behaviors. And they are called well-known symbols. You can have a list on Mozilla Developer Network... Inside the documentation "@@" is used to denote a symbol so you can look for "@@iterator"
@RobertWildling
@RobertWildling 5 жыл бұрын
Indeed that is fun, especially when it is presented in such an entertaining, well-done video! Thank you! Instead of adding an additional result variable, I did this: next() { if(current
@romikonlinepotapenko3475
@romikonlinepotapenko3475 4 жыл бұрын
Hi Colt, could you explain why the spread operator works with object literals?. For example, I can create a copy of an object by using spread although it is not considered iterable: const person = { firstname: "John", lastname: "Doe" }; const clone = {...person}; console.log(clone);
@PriyaSingh-th7ue
@PriyaSingh-th7ue 3 жыл бұрын
Can you share the code where you displayed reversed array
@AssemblyWizard
@AssemblyWizard 5 жыл бұрын
6:17 Python has almost exactly the same iterable & iterator protocol... (except StopIteration which is a bit better)
@shubhamdogra6118
@shubhamdogra6118 5 жыл бұрын
Actually there is a issue I am facing in jQuery section.in web developer bootcamp course . I can't use the property .css. I am using latest j query .It keeps saying type error .css() is not defined ..need help!!!!
@lukascoorek
@lukascoorek 5 жыл бұрын
Can't see the link to the notes?
@AbhinavKulshreshtha
@AbhinavKulshreshtha 5 жыл бұрын
I have a feeling you are using firefox dev tools, How did you set it like that. It feels awesome. Is it firefox developer edition?
@miunify
@miunify 5 жыл бұрын
JavaScript is so fun
@Sarahchamorro
@Sarahchamorro 5 жыл бұрын
I do find Javascript fun though, why the shade?
@yuhceeofficial
@yuhceeofficial 5 жыл бұрын
How do you approach a programming problem that is new to you and solve it. Please can you show us the way you find your answers and solutions without wasting much time on it.
@wasifnaqvi2213
@wasifnaqvi2213 5 жыл бұрын
google about it and apply it to your problems, and be patient, stackoverflow and the communities will help you.
@evenaicantfigurethisout
@evenaicantfigurethisout 3 жыл бұрын
what does an iterator have to do with Javascript symbols? i thought symbols were just a way of hiding properties like id. why is iterator embedded under Symbol? and why is it that when i try to access Symbol, it is undefined, like "hi"[Symbol], and yet "hi"[Symbol.iterator] exists? how it it possible for the child Symbol.iterator to exist and yet its parent Symbol does not exist?
@Luxcium
@Luxcium 5 жыл бұрын
Colt is not on Twitter ?
@LofiWurld
@LofiWurld 4 жыл бұрын
For a second i thought javascript became pretty like python
@aymanayman9000
@aymanayman9000 5 жыл бұрын
Python did that with a better approach by far just with two functions iter and next
@manishsahani4867
@manishsahani4867 5 жыл бұрын
please make React infinite scroll video
JS Arrow Functions: Everything You Need to Know
20:23
Colt Steele
Рет қаралды 31 М.
Complete Guide to JS Sets: How They Work & When To Use Them
18:38
Please Help Barry Choose His Real Son
00:23
Garri Creative
Рет қаралды 23 МЛН
When you discover a family secret
00:59
im_siowei
Рет қаралды 22 МЛН
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 4 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 15 МЛН
Complete Guide to JS Async & Await ES2017/ES8
16:20
Colt Steele
Рет қаралды 18 М.
Recursion Crash Course
16:46
Colt Steele
Рет қаралды 68 М.
Complete Beginner's Guide to Big O Notation
21:58
Colt Steele
Рет қаралды 228 М.
JS Spread Operator: How It Works & Why I Love It
16:31
Colt Steele
Рет қаралды 76 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
CSS Specificity: What You Need To Know
12:01
Colt Steele
Рет қаралды 12 М.
Regular Expressions (Regex) Mini Bootcamp
46:03
Colt Steele
Рет қаралды 24 М.
Learn Git In 15 Minutes
15:59
Colt Steele
Рет қаралды 2 МЛН
The Beginner's Guide To Terminal (For Webdev/Data Science)
55:19
Colt Steele
Рет қаралды 23 М.
The Complete Guide to JS Symbols ES6
12:18
Colt Steele
Рет қаралды 53 М.
Мой новый мега монитор!🤯
1:00
Корнеич
Рет қаралды 8 МЛН
САМЫЙ ОПАСНЫЙ iPHONE В МИРЕ 🤯 #iphone
1:01
ТЕХНОБЛОГ АЛИША
Рет қаралды 309 М.
💀СЛОМАЛ Айфон за 5 СЕКУНД😱
0:26
Demin's Lounge
Рет қаралды 766 М.
Nokia vs Jio ❤️‍🩹 #phonk #trollface
0:14
Arka J.D.R.O
Рет қаралды 101 М.
Тест Ryzen AI 9 HX 370 и графики 890m
27:29
PRO Hi-Tech
Рет қаралды 97 М.