JSFiddle - React, Tailwind, and code Playground

by Emily Humphrey

JavaScript

var total = 27,
    current = 0;

setInterval(function(){
    current++;
    console.log()
    console.log(current+" = "+getPercentage(total, current)+"%")
}, 1000);

function getPercentage(total, number){
    return Math.round(number/total*100);
}