Skip to content

Instantly share code, notes, and snippets.

@devrusty
Created September 5, 2022 03:10
Embed
What would you like to do?
A function that generates a progress bar using emojis.
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