Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

then and catch in promise

try {
   let hello = prompt(“Type hello”)
   if (hello !== ‘hello’){
     throw new Error(“Oops, you didn’t type hello”)
   }
} catch(e) {
   alert(e.message)
} finally {
   alert(‘thanks for playing!’)
}
Comment

then and catch in promise

try {
   let hello = prompt(“Type hello”)
   if (hello !== ‘hello’){
     throw new Error(“Oops, you didn’t type hello”)
   }
} catch(e) {
   alert(e.message)
} finally {
   alert(‘thanks for playing!’)
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript regex One or more occurrences of the pattern 
Javascript :: math.floor 
Javascript :: includes in js 
Javascript :: difference between normal function and arrow function 
Javascript :: create an empty array js 
Javascript :: WebPack basic Configuration 
Javascript :: how to create a class javascript 
Javascript :: perent to child data pass in angular 
Javascript :: Get the Last Items in an Array 
Javascript :: create neact native app 
Javascript :: js outputting data 
Javascript :: window.location.origin 
Javascript :: javascript apply 
Javascript :: obfuscation js 
Javascript :: blur js 
Javascript :: Promises ex. 
Javascript :: array flatten 
Javascript :: monaco editor events 
Javascript :: get previous link javascript 
Javascript :: nodejs s3 list objects from folder 
Javascript :: javascript best way to loop through array 
Javascript :: animate change background color angular 
Javascript :: remove from string javascript regex 
Javascript :: create a pdf puppeteer js 
Javascript :: how to do jest unit test in react 
Javascript :: run node script pupeeter when button from form clicked 
Javascript :: how to select an adjacent element javascript 
Javascript :: next js css background image 
Javascript :: javascript shift 
Javascript :: Create Your Own Node Module 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =