SOURCE

console 命令行工具 X clear

                    
>
console
//const repeatFunc = repeat(alert, 4, 3000)
function repeat(func, time, wait) {
    let counter = 0;
    const intervalId = setInterval(() => {
        func;
        counter += 1;
        console.log(counter)
        if (counter === time) {
            console.log('Done');
            clearInterval(intervalId);
        }
    }, time * 1000)
}
function hhh(words) {
    console.log(words)
}
function repeatedFunc(word) {
    var words = word
    repeat(hhh(words), 4, 1000)
}
//repeatedFunc("hellworld")
var N = []
N[0] = document.getElementById(1)
N[1] = document.getElementById(2)
N[2] = document.getElementById(3)
N[3] = document.getElementById(4)
N[4] = document.getElementById(5)
function setColor(){
    for(let i = 0; i<5;i++){
        N[i].onclick = function(){
            for(let j = 0;j<=i;j++){
                console.log(j)
                N[j].style.color = 'yellow'
            }
            for(let r = i+1;r<5;r++){
                N[r].style.color = 'rgb(201, 201, 201)'
            }
        }
    }
}
setColor()
<div class="cnm">
	<div class="hh" id="1">&#9733;</div>
	<div class="hh" id="2">&#9733;</div>
    <div class="hh" id="3">&#9733;</div>
    <div class="hh" id="4">&#9733;</div>
    <div class="hh" id="5">&#9733;</div>
</div>
.hh {
    display: block;
    margin: 0 auto;
    width: 20px;
    height: 20px;
    color: rgb(201, 201, 201);
}

.cnm {
    display: flex;
    justify-content: center;
    text-align: center;
}