16.15: Promise.all() - Topics of JavaScript/ES6
HTML-код
- Опубликовано: 31 май 2018
- In this video, I discuss handling arrays of asynchronous JavaScript promises with Promise.all() .
🎥 Next Video: • 16.16: try / catch wit...
🔗 Promise.all() on MDN: developer.mozilla.org/en-US/d...
🔗 Giphy API: developers.giphy.com/
🔗 Wordnik API: developer.wordnik.com/
🎥 ES6 Arrow Function: • 16.3: ES6 Arrow Functi...
🚂 Website: thecodingtrain.com/
💖 Patreon: / codingtrain
🛒 Store: www.designbyhumans.com/shop/c...
📚 Book recommendations: www.amazon.com/shop/thecoding...
💻 github.com/CodingTrain/website
🎥 For more videos on ES6/JavaScript: • 16: Topics of JavaScri...
🎥 For more Coding Challenges: • Coding Challenges
🔗 p5js.org/
🔗 processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
Never stop doing these. This is positively the best coding channel on RUclips.
the most impressive thing about daniel shiffman is that he somehow learned to code *without* watching any coding train videos
i guess it's kinda randomly asking but does anybody know of a good site to stream newly released movies online?
@Arlo Musa try flixzone. Just google for it :)
@Vincent Ethan definitely, been using FlixZone for years myself =)
@Vincent Ethan thanks, I signed up and it seems to work :D Appreciate it!
@Arlo Musa happy to help :D
Damn i just saw his async await in recommendations list. This guy says "in my previous video" .
Me: ok let me check first of the series
I just forgot I'm here to gain knowledge and watched as if its a movie.
Believe it or not I'm into JS and react since 2 years. Never got this stuff stuck in my head as better as this.
I'm just grateful to u. Thanks a ton
I've decided to really understand async JS, instead of just doing api calls without fully knowing what's going on and your videos helped a lot. they're fantastic.
Thank you for the series! Going through the evolution of the asynchronous concept step by step made it a lot more clearer to me.
10:42 "aPEARing" 😎
leave immediately
it's actaully nice to see it live and how these small mistakes happen to everyone - nice work in all!
Thanks for these videos. These are super good and breaks everything down in a very entertaining way yet super educative.
oh my gosh, this is so useful for what I am doing. thank you!!
Thank you man thank you. It sucks that I am paying for a curse and keep coming back here to understand whats going on in the paid course. I will contribute for sure my friend!
Thank You very much Sir. This is one of the best coding tutorials I have seen.
keep doing great work sir, this is the first time I watch your video and I am impressed with your enthusiasm and passion thank you you have my support
one of the best coding channel. you are very cool way of sharing your knowledge to others. Great job.
Thank you for your awesome videos! Very good examples.
02:10 "I'm trapped in an ATM vestibule with Jill Goodacre!"\
On a more serious note, I am getting ready for an interview, and this really helped me understand Promise.all(). Thanks!
Always so helpful. Thank you!
My dude, thank you very much! I was having this problem creating a list for the sidebar navigation of my site.
the skeleton made it immediately clear to me, and i didn't realize it required an array as argument.. great vid thnx
This video is amazing! You're the best!
They're returned in the same exact order as they were set in the array, that's the main takeaway for u if ur in a hurry or on an urgent product bug fix, like i was :D finely explained !
Another great video, as usual.
You make things look easy!
Great video my friend! Thank you. Take care😁😄
Great videos! thanks for making the concept clear in such a simple way..
Thank you for the support!
A great Teacher you are
Seriously dude, one of the best tutorial serie out there
hello sir, really you are amezing.. bcoz you create a comic environment while occurring error on your video and its intresting
Great video. Thank you for sharing.
Thank you soo much!, I understand now!
detailed explaination... why and how it works this way .. thanks for this video
Awesome tutorial as always! I have been having this issue on my program that I'm doing for fun where I need to add a sleep to a function but I want the draw loop to keep going. I wonder if I can use this async/await to work around this?! I haven't worked on it for several months now but if I get back to it, I wonder if it will solve the problem. I'm excited to try it!
you are my favourite coder
amazing series .. I had started with part 1 with no idea about promises but now I can promise that how to keep promise ;-)
i loved every minute of this
That's what she said 🤣
You are so good!
You could like in try catch send a resolve in the catch too. Then you'd not get an error that breaks the promise chain but still could in the catch jump the creation of the html elements but display an error gif instead. Of course it's fishy to use a resolve() in case of an error but here it would make sense since you still want the other gifs that work.
This was amazing
you are awesome. thank you so much.
Thank you! Sir.
Great video man! Perfect timing too, that's a thumbs up from me! :)
thanks. helpful video.
you are so cool bro keep doing tutorials
Thanks a lot bro
Thank you so much. . .
yes kids, there is no onerror callback! If any of the promises doesn't work out nothing works anymore.
Welcome to 2021!
Great Series! Thanks you. I've always wondered, what text editor do you use?
VSCode This workflow video series might help! ruclips.net/p/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X
Hey! your videos are great! Can you make a video on how to read source code of a javascript related open source project, or just what should be the approach to jumping into source code? [PLEASE!]
Shaswat lenka step 1- open gitbub, 2- find src folder or appropriate folder if its a mono repo, 3- start reading source code based on what you are interested ib
Hey Abdalla! I know these things. Usually, Open Source Projects have a lot of dependencies and reading the source code becomes a heck of a job. I wanted a foolproof approach to dive into the large codebase and how to know what was in the mind of the programmer while writing a particular line of code.
So what's gonna be the alternative when we want to avoid that all will fail if one fail but still execute the code in the similar fashion?
Oh yeah some websites lag a lot when loading all the ads and pictures and whatnot, and so they start to "crawl". I hate that, like I just aligned the article with my screen and now it's crawling down and I need to scroll again.
Can you do a video on the loading bar?
Thanks
Wow that's so useful. Code is still becoming easier to learn and also to write. I think ES267 will have preincluded functions from P5.JS XD.
what is es267? is that a specification number like java has with jsr etc? new to javascript. thanks
He was just making a joke about a super-future version of the standard that would include functions from the P5JS library. ES5, ES6, ES7 and ES8 are the currently used specification versions. en.wikipedia.org/wiki/ECMAScript
oh ok. thanks. :D
to jo. Java krade od ceckaru a p5 od javy.
Why would a for loop prevent the promise.all() to fail, if there's an error, where as the promise.all() by itself totally fail? Can someone provide a topic or subject on how this works so I could do a little more research online
thankyouu so much
whoops,,,,,, you are awesome
whooOOOps,,,,,,, what an interesting series
whoops ,,, whoops ,,,
your teaching style is out of the box☺️ 😍 🎸 🙌 👏
Hey, does this work as ACID wrapper with the DB's? What I mean by that is if array of promises would simply be calls to mongodb and if any of them fail how does this all or nothing work then ? Thank you.
@2:50 word is, interpolation
You are amazing. Pls make a react series 😩😩😩😩
11:00 why would you use that ugly for loop though?
albeit a little bumpy, still very informative, ty
I love unlisted videos
fun stuff
Anyone can tell me the difference between doing the promise all like he did VS
Promise.all(promises.map(async(promise,i)=>{
let data = await someRandomFunctionThatDelayIsRandom()
return data
})
Thank u very much
hi sir please make tutorial for arcgis api.. how can we publish json service from arcgis server to map and how can i edit json service as a client(means to say live editing on map to create line, point and polygon).
Hey! I'm new to JS so I didn't get one thing: why is the wordGIF function returning a Promise? It seems to me like it is returning an object with the 'let' variables results but you're able to handle it as a promise... Can anyone help me?
I know my reply is pretty late, but I looked it up and the reason behind wordGIF returning a promise is that async functions always return promises, so whenever you don't specify that it's a promise, the return value is wrapped in a resolved promise.
So if you had a function like:
async function 7isTheBestNumber() {
return 7;
}
It would be the exact same as writing:
async function 7isTheBestNumber() {
return Promise.resolve(7);
}
I hope this helps!
+Gabe Chevalier ah, okay, makes sense. Cool! Thank you, Gabe!
Please make a video promise.all() in angular. Thanks
Please make a separate playlist for Topics of Javascript/ES6.
ruclips.net/p/PLRqwX-V7Uu6YgpA3Oht-7B4NBQwFVe3pr
@@TheCodingTrain Thank you so much for your quick response
What are you programming on?
how do you tell javascript if the right mouse button is click?
hey javascript i am clicking the right mouse heck yeah !!
Async function returns a promise. Period. Async function returns an object which has the word and the image url. It somehow feels a lot confusing. Can you please explain this? Thanks.
"The async function declaration defines an asynchronous function, which returns an AsyncFunction object. "
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
It simply wraps the returned object into a new promise instead, because the function is async.
Where can I see the Livestream? It looks like this video was just uploaded to RUclips.
Are you using Twitch or something like that?
I live stream right here on this channel! Click subscribe and the alarm bell to get notifications.
I already subscribed but didn't activate notifications (I changed that now and this is the second channel where I did that).
I'm used to the live chat that is displayed on live streamed videos even after the stream stopped. So I thought you brodcast the stream somewhere else.
Do you cut the recorded stream into pieces and upload it sepreatel like regular videos and is that the reason why I don't see the chat?
@2:02 Does anyone know if once you have confirmed your application works correctly, in order to deal with a word from wordnikAPI not matching with a gif from giphyAPI, could you use a recursive approach and call on wordGif(num) again in the error handling? Would it keep running until it found a match for all words used to display?
Yes I think we can add one more recursive call in .catch
would change the "for" loop with a .forEach() :)
Very nice. Excellent explanation with a good use case.
It's "JIF" though.
Nooooooooooooooooo!!!
it seems to me like using DO , WHILE instead of............
I get CORS error when fetching from GIPHY. Sometimes it works, but most of the time it returns this error..
U gotta create a new http Agent that doesnt reject unauthorized and pass it to the config of fetch
const agent = new https.Agent({
rejectUnauthorized: false
})
create a config variable and pass it to the fetch api. Maybe look it up in the docs.
9:25 me when I try to optimize the code which somehow worked
Promise.Race
Please share your secret for getting high on life :)
Could you by any chance make a program in java that accesses excel and outputs it? Preferably in Eclipse Work-space and using the jxl plugins. It would help me learn the plugin and software a lot and I would GREATLY appreciate it. :)
9:25 Hamza is actually my name xd
please make video on recurrent neural network in javascript
i have to drop a like anyway, its Danial
code in github ?
Can you make a snake game AI with tenserflow
you are lovely