High Definition Standard Definition Theater
Video id : ITogH7lJTyE
ImmersiveAmbientModecolor: #f5d647 (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeEncryptID: e64d807c1aee98a23e49fa68d778e649bb0dab913da22ad2607a269244d4bc3a958d2cb30a3cf26dca91caac8861e243
Proxy : eu-proxy.poketube.fun - refresh the page to change the proxy location
Date : 1732241835629 - unknown on Apple WebKit
Mystery text : SVRvZ0g3bEpUeUUgaSAgbG92ICB1IGV1LXByb3h5LnBva2V0dWJlLmZ1bg==
143 : true
1,345,077 Views • Jun 8, 2021 • Click to toggle off description
Async Await is heaven... until error handling comes into play. Learn how to avoid try/catch hell when writing async JavaScript code.

#shorts #js #programming
Metadata And Engagement

Views : 1,345,077
Genre: Science & Technology
License: Standard YouTube License
Uploaded At Jun 8, 2021 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.95 (1,002/79,306 LTDR)

98.75% of the users lieked the video!!
1.25% of the users dislieked the video!!
User score: 98.13- Masterpiece Video

RYD date created : 2022-04-09T14:16:37.494032Z
See in json
Connections
Nyo connections found on the description ;_; report an issue lol

1,231 Comments

Top Comments of this video!! :3

@gabriel.quagliano

3 years ago

Protip: Avoid the pyramid of doom by never indenting your code 🤙

5.2K |

@lvenir4702

3 years ago

"a sink"
"a weight"

k

1.4K |

@tdubab

3 years ago

Basically you made Javascript looks like Golang Lol.

3.5K |

@wumbl3

3 years ago

My life is pretty dull and uneventful, so this was the best 45 seconds of my life.

926 |

@alexeyl1739

3 years ago

Congrats! You one step closer to using monads for error handling

897 |

@arwahsapi

3 years ago

I've been asynchronously awaiting for this and finally this video showed up

126 |

@truedarkness1337

3 years ago

the best 45 seconds of my life

1.2K |

@Toleich

1 year ago

And we're coming full circle.

76 |

@bensas42

3 years ago

Holy shit, most youtubers would have turned this into a 10 minute monetized video. You are amazing.

153 |

@erbesharat

3 years ago

This reminds me of a quote:
"Errors are values"

202 |

@rumplstiltztinkerstein

3 years ago

rust developers can just put ? in front of the function. If an error occurs, the function halts and returns the error. It's awesome for those that understand it, a nightmare for someone unfamiliar with rust lol.

58 |

@Ipauler

3 years ago

And then you will end up with tower of ifs, when each function depends on previous results
You've just writed try catch using if statements nothing changed
What you can do is catch them all together
And make specific errors for each function and then switch through errors in catch block if you need to perform something for each error case

66 |

@TheHy6xD

3 years ago

Swift just got Async/ Await feature and now I'm getting this as recommended.

6 |

@Appl3Muncher

3 years ago

The difference is honestly astounding. I want to get better at writing clean JavaScript code thanks.

2 |

@beorntwit711

3 years ago

Such a quality of life improvement. I read this in an article once, when I was just starting out, and started writing it, just waiting for the other shoe to drop (I had to defend it before my boss, who was skeptical at first, even though he hated try catch and longed for the async.js days); cause why wasn't everyone doing this? No regrets!

3 |

@Vaidd4

3 years ago

Tips:
- Make the function take a promise as a parameter
- use "catch" method of the promise
- Call this function "to"

function to (promise) {
return promise.then(data => [null, data]).catch(err => [err])
}

const [err, data] = await to(fetch(/*thatUrl*/))


Notes: Dont need to have an async function or to use try-catch; its reusable for any function returning a promise; its a oneliner in a oneliner \o/

17 |

@catherineepps9175

3 years ago

I'm starting to love programming. I enjoy it now. I understand it now.

6 |

@dkosmari

3 years ago

Looks a lot like Andrei Alexandrescu's "Expected<T>" from his 2012 talk. It's a variant that stores either the value, or an exception. But C++'s operator overloading makes it more convenient to use.

1 |

@oglothenerd

9 months ago

Return error as value is amazing. I love Rust.

5 |

@maxpowers1015

3 years ago

Absolutely love the conciseness

1 |

Go To Top