VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
try, catch, finally, throw - error handling in JavaScript

try, catch, finally, throw - error handling in JavaScript

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Error handling in JavaScript uses the keywords: try, catch, finally, and throw. - Code: https://codepen.io/beaucarnes/pen/rwBmWE?editors=0012 - https://javascript.info/try-catch - Beau Carnes on
Date: 2022-03-14

Comments and reviews: 6


// error handling use the following keyword:-
// 1.try => lets you check the code for errors-
// 2.catch => lets you handle the error-
// 3.throw => lets you create a custom error-
// 4.finally => lets you execute code after try and catch regardless of all the result-
#harrybhai

reply

Thanks for the very clear explanation, but I'm trying to trap an error in the following document write statement (when the file doesn't exist). Evidently it is not throwing any error to detect when the file does is not found, any ideas?
document.write('')

reply

How does js connects the -message- with what's written inside the parenthesis?? There's no var or something attributed to -message-...is it one of those standardised things?
reply

Hey, Mr. Carnes. Great video. Question: do you have to rely on any dependencies to run this code? Like a unit testing library/module or something? Thanks so much.
reply

Hi, if when throwing an error it jumps to the catch() method-(skipping the console.log), how do you throw multiple errors?
reply

You, I love you. Just found you at random. Your videos are clear and concise and seem to always be about a specific point.
reply
Add a review, comment






Other channel videos