Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node js try catch

try {
  nonExistentFunction();
} catch (error) {
  console.error(error);
  // expected output: ReferenceError: nonExistentFunction is not defined
  // Note - error messages will vary depending on browser
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #node #js #catch
ADD COMMENT
Topic
Name
8+1 =