//synchronous:
// [Link]("hi");
// [Link]("hello");
// function myFirst() {
// [Link]("hello");
// }
// function mySecond() {
// [Link]("world");
// }
// mySecond();
// myFirst();
//asynchronous:
// [Link]("hi") //hi
// setTimeout(()=> {
// [Link]("world")
// }, 3000) //after 3 second it
will print
// [Link]("hello") // hello
// setInterval(() => {
// let d = new Date();
// [Link]([Link]()+":"+[Link]
tMinutes()+":"+[Link]());
// },3000);
// //Promise Object
// const myPromise = new Promise((res,
rej) => {
// setTimeout(() => {
// res("done");
// }, 3000);
// });
// [Link](function (value) {
// [Link](value);
// });
// // if true then it prints success
// let ans = new Promise((res, rej) =>
{
// if (true) {
// return res();
// } else {
// return rej();
// }
// });
// ans
// .then(function () {
// [Link]("success");
// })
// .catch(() => {
// [Link]("fall");
// });
// // if false then it prints fall
// let ans1 = new Promise((res, rej)
=> {
// if (false) {
// return res();
// } else {
// return rej();
// }
// });
// ans1
// .then(function () {
// [Link]("success");
// })
// .catch(() => {
// [Link]("fall");
// });
//async and await
async function abcd() { //async return
a promise
let result = await
fetch("[Link]
");//await waits for a promise
let data = await [Link]();
[Link](data);
}
abcd();