JavaScript Error handling in 9 minutes! ⚠

  Рет қаралды 21,663

Bro Code

Bro Code

Күн бұрын

Пікірлер: 20
@BroCodez
@BroCodez Жыл бұрын
// Error = An Object that is created to represent a problem that occurs // Occur often with user input or establishing a connection // try { } = Encloses code that might potentially cause an error // catch { } = Catch and handle any thrown Errors from try { } // finally { } = (optional) Always executes. Used mostly for clean up // ex. close files, close connections, release resources try{ const dividend = Number(window.prompt("Enter a dividend: ")); const divisor = Number(window.prompt("Enter a divisor: ")); if(divisor == 0){ throw new Error("You can't divide by zero!"); } if(isNaN(dividend) || isNaN(divisor)){ throw new Error("Values must be a number"); } const result = dividend / divisor; console.log(result); } catch(error){ console.error(error); } finally{ console.log("This always executes"); } console.log("You have reached the end!");
@yeeter420
@yeeter420 Ай бұрын
One of the best channels for learning code. Thank you❤
@justmakeitviral4733
@justmakeitviral4733 Жыл бұрын
I love these short videos....it's good for revision
@slimak1278
@slimak1278 Ай бұрын
Thanks, we learned quite a bit about JavaScript in school, but we didn't learn how to handle errors, so again, thank you.
@xmorlanzz
@xmorlanzz Жыл бұрын
repetition is the mother of learning, fellow programmers!
@fadelsaad6623
@fadelsaad6623 28 күн бұрын
Dude thank you, It seemed much harder to me but after watching the vid it makes so much sense
@Sijo2
@Sijo2 11 ай бұрын
Thank you for this tutorial video. I really helped my understanding
@hunin27
@hunin27 Жыл бұрын
i always did lots of if statements to handle errors and i thought it was the best way lol
@teoanilacar
@teoanilacar 9 ай бұрын
This guy is awesome!
@jahazielvazquez7264
@jahazielvazquez7264 11 ай бұрын
Clear as day! Thank you good sir
@dev_ression
@dev_ression Жыл бұрын
nicely explained bro, thank you!
@popsbeats_100
@popsbeats_100 4 ай бұрын
Beautiful👌🏿
@ProgrammingJourney-hk6wf
@ProgrammingJourney-hk6wf Ай бұрын
Thank you bro ❤. Very well explained!
@subinkv6849
@subinkv6849 11 ай бұрын
Great content..
@EnzoJasonCotia
@EnzoJasonCotia 5 ай бұрын
Thank you 😢
@s.a.r.a.01
@s.a.r.a.01 5 ай бұрын
thank you for this
@dimitro.cardellini
@dimitro.cardellini 8 ай бұрын
But why not just check if result is Infinity or NaN after we performed the division? Actually, the fact that JS doesn't fail on division by zero is an intentional feature of JS.
@hunin27
@hunin27 Жыл бұрын
thanks bro
@asifahmed6568
@asifahmed6568 Жыл бұрын
🎉🎉🎉🎉🎉🎉❤
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 781 М.
"Идеальное" преступление
0:39
Кик Брейнс
Рет қаралды 1,4 МЛН
Handmade Hero Day 001 - Setting Up the Windows Build
1:13:51
Molly Rocket
Рет қаралды 377 М.
Learn JavaScript CALLBACKS in 7 minutes! 🤙
7:17
Bro Code
Рет қаралды 81 М.
I'm Ditching Try/Catch for Good!
10:29
Web Dev Simplified
Рет қаралды 199 М.
Error handling in TypeScript. How to avoid exceptions.
6:11
Beyond TypeScript
Рет қаралды 4,9 М.
JavaScript GETTERS & SETTERS are awesome!!! 📐
13:14
Bro Code
Рет қаралды 22 М.
The Actual Dumbest Thing About Try/Catch
11:47
Theo - t3․gg
Рет қаралды 49 М.
JavaScript Error Handling: 5 Things You Aren’t Thinking About!
14:42
Java exception handling ⚠️
7:53
Bro Code
Рет қаралды 127 М.
try, catch, finally, throw - error handling in JavaScript
5:46
freeCodeCamp.org
Рет қаралды 179 М.