Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to catch and throw error js

try {
  throw new Error('Whoops!')
} catch (e) {
  console.error(e.name + ': ' + e.message)
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #catch #throw #error #js
ADD COMMENT
Topic
Name
9+9 =