Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

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

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

JavaScript Error handling in 9 minutes! ⚠

Автор: Bro Code

Загружено: 2023-11-30

Просмотров: 29583

Описание:

#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!");

JavaScript Error handling in 9 minutes! ⚠

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

array(10) { [0]=> object(stdClass)#5344 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "I5kj-YsmWjM" ["related_video_title"]=> string(44) "Build this JS calculator in 15 minutes! 🖩" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(8) "Bro Code" } [1]=> object(stdClass)#5317 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "blBoIyNhGvY" ["related_video_title"]=> string(75) "Javascript Error Handling | Handle Errors in Javascript | Try Catch Finally" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(9) "Dave Gray" } [2]=> object(stdClass)#5342 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "PSYzEj67lPA" ["related_video_title"]=> string(95) "Build a SVG Viewer & Editor in Browser to Render & Edit SVG Using HTML & JavaScript" ["posted_time"]=> string(70) "Трансляция закончилась 31 минуту назад" ["channelName"]=> string(14) "Coding Shiksha" } [3]=> object(stdClass)#5349 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "NOzi4wBHn0o" ["related_video_title"]=> string(34) "What are JavaScript PROMISES? 🤞" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(8) "Bro Code" } [4]=> object(stdClass)#5328 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "l62mMMU4ZqA" ["related_video_title"]=> string(68) "JavaScript Error Handling: 5 Things You Aren’t Thinking About!" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(13) "James Q Quick" } [5]=> object(stdClass)#5346 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "gPKzwAORly8" ["related_video_title"]=> string(46) "JavaScript Global Execution Context Explained!" ["posted_time"]=> string(27) "7 месяцев назад" ["channelName"]=> string(11) "Piyush Garg" } [6]=> object(stdClass)#5341 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "62qN2RcpIAE" ["related_video_title"]=> string(50) "Learn the JavaScript classList property easy! 💡" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(8) "Bro Code" } [7]=> object(stdClass)#5351 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "aQRj2Z-Eb1Y" ["related_video_title"]=> string(129) "⚡️ Самая масштабная атака РФ по Украине || Путина просят о помиловании" ["posted_time"]=> string(24) "11 часов назад" ["channelName"]=> string(23) "Время Прядко" } [8]=> object(stdClass)#5327 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "1U44SbOa7rE" ["related_video_title"]=> string(65) "The PROBLEM With Error Handling in Typescript (and how to fix it)" ["posted_time"]=> string(28) "10 месяцев назад" ["channelName"]=> string(11) "Ethan Niser" } [9]=> object(stdClass)#5345 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "FQtjI1PC5Z0" ["related_video_title"]=> string(45) "Learn JavaScript ELEMENT SELECTORS easy! 📑" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(8) "Bro Code" } }
Build this JS calculator in 15 minutes! 🖩

Build this JS calculator in 15 minutes! 🖩

Javascript Error Handling | Handle Errors in Javascript | Try Catch Finally

Javascript Error Handling | Handle Errors in Javascript | Try Catch Finally

Build a SVG Viewer & Editor in Browser to Render & Edit SVG Using HTML & JavaScript

Build a SVG Viewer & Editor in Browser to Render & Edit SVG Using HTML & JavaScript

What are JavaScript PROMISES? 🤞

What are JavaScript PROMISES? 🤞

JavaScript Error Handling: 5 Things You Aren’t Thinking About!

JavaScript Error Handling: 5 Things You Aren’t Thinking About!

JavaScript Global Execution Context Explained!

JavaScript Global Execution Context Explained!

Learn the JavaScript classList property easy! 💡

Learn the JavaScript classList property easy! 💡

⚡️ Самая масштабная атака РФ по Украине || Путина просят о помиловании

⚡️ Самая масштабная атака РФ по Украине || Путина просят о помиловании

The PROBLEM With Error Handling in Typescript (and how to fix it)

The PROBLEM With Error Handling in Typescript (and how to fix it)

Learn JavaScript ELEMENT SELECTORS easy! 📑

Learn JavaScript ELEMENT SELECTORS easy! 📑

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]