We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f32e10 commit 719c62eCopy full SHA for 719c62e
projects/profile-statistics/index.js
@@ -1,12 +1,14 @@
1
const countersEl = document.querySelectorAll(".counter");
2
-
+//Iterate over each elements in the counter
3
countersEl.forEach((counterEl) => {
4
+ //Initial value of the counter to zero
5
counterEl.innerText = "0";
6
incrementCounter();
7
function incrementCounter() {
8
let currentNum = +counterEl.innerText;
9
const dataCeil = counterEl.getAttribute("data-ceil");
10
const increment = dataCeil / 15;
11
+ //Math.ceil()= round to the nearest integer
12
currentNum = Math.ceil(currentNum + increment);
13
14
if (currentNum < dataCeil) {
0 commit comments