Create Lift program in Javascript, How to create real-time lift in JS

0

 Create Lift program in Javascript, How to create real-time lift in JS:

Write a Program to create lift program where no of floor and

total lift movement entered by the user's.


function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
  }
 
  async function delayedGreetingsLoop() {
    let n=1; //take from users also
    while(n<=10) {
        if(n<=5)
            {
                console.log(`floor #${n}`);
            }
            else
            {
                console.log(`floor #${11-n}`);
            }
      await sleep(1000);
      n++;
     
    }
  }

  delayedGreetingsLoop();
......................................................................................
......................................................................................





Tags

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)