Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
  </head>
  <body>
  </body>
</html>
 
const delayedGreeting = () => {
  console.log('Hi, sorry for the wait!')
}
/*
 call setTimout(), it accepts 2 parameters
 1. callback (function to be executed)
 2. delay in milliseconds (1000 ms = 1 sec)
*/
console.log('calling .setTimeout()')
setTimeout(delayedGreeting, 3000)
console.log('end of the code')
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x