<button id="click">Click</button>
<p>Click Count: <span style="font-weight:bold;" id="count"></span></p>
<p>SUM: <span style="font-weight:bold;" id="sum"></span></p>const btn = document.getElementById('click');
const countEle = document.getElementById('count');
const sumEle = document.getElementById('sum');
let sum = 0;
let count = 0;
const MAX = 1e9;
const updateSUM = () => {
sumEle.innerHTML = sum;
}
const updateClickCount = () => {
count += 1;
console.log(count);
countEle.innerHTML = count;
}
const sumFrom1ToMax = () => {
// write your code here
updateSUM();
}
btn.onclick = async (e) => {
console.log('click');
updateClickCount();
sumFrom1ToMax();
}
