Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб JavaScript Error handling in 9 minutes! ⚠ в хорошем качестве

JavaScript Error handling in 9 minutes! ⚠ 10 месяцев назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



JavaScript Error handling in 9 minutes! ⚠

#JavaScript #tutorial #course 00:00:00 introduction 00:00:18 Errors 00:01:36 try/catch 00:02:38 console.error() 00:02:58 finally 00:04:16 throw new Error() 00:08:28 conclusion // 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!");

Comments