desito07

Loading Bar

Jun 16th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function solve(num) {
  2. let percentages = `%`.repeat(num / 10);
  3. let dotts = `.`.repeat(10 - num / 10);
  4.  
  5. if (num === 100) {
  6. console.log(`${num}% Complete!`);
  7. console.log(`[${percentages}]`);
  8. } else {
  9. console.log(`${num}% [${percentages}${dotts}]`);
  10. console.log(`Still loading...`);
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment