Synchronous, Asynchronous, Promise Object, Async, Await
Synchronous, Asynchronous, Promise Object, Async, Await
// console.log("hi");
// console.log("hello");
// function myFirst() {
// console.log("hello");
// }
// function mySecond() {
// console.log("world");
// }
// mySecond();
// myFirst();
//asynchronous:
// console.log("hi") //hi
// setTimeout(()=> {
// console.log("world")
// }, 3000) //after 3 second it
will print
// console.log("hello") // hello
// setInterval(() => {
// let d = new Date();
// console.log(d.getHours()+":"+d.ge
tMinutes()+":"+d.getSeconds());
// },3000);
// //Promise Object
// const myPromise = new Promise((res,
rej) => {
// setTimeout(() => {
// res("done");
// }, 3000);
// });
// myPromise.then(function (value) {
// console.log(value);
// });