Advertisement
vladovip

Loading Bar_09_JS Fund_Function Ex

Feb 5th, 2022
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function loadingBar(number) {
  3.  
  4.   let counter = number/10;
  5.   let procentages = "%".repeat(counter);
  6.   let dots = ".".repeat(10 - counter);
  7.  
  8.   if (number === 100) {
  9.     console.log(`${number}% Complete!`);
  10.     console.log(`[${procentages}]`);
  11.   } else {
  12.     console.log(`${number}% [${procentages}${dots}]`);
  13.     console.log(`Still loading...`);
  14.   }
  15. }
  16. loadingBar (50);
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement