Created
September 5, 2022 03:10
-
-
Save compscitwilight/52fa99e0cfa8a15b1a23ddb354fd0083 to your computer and use it in GitHub Desktop.
A function that generates a progress bar using emojis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const max = 10 | |
function CreateProgressBar(progress: number) { | |
if (progress > max) { | |
console.log(`Progress bar is out of range of ${max}`) | |
return | |
} | |
const progressBar = `${"🟩".repeat(progress)}${"⬛".repeat(max - progress)}` | |
return progressBar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment