[Javascript] Using console.count to Count Events

Learn how to user console.count in order to log out how many times a given thing has happened.

 

for(var i = 0; i < 10; i++){
    var num = Math.random() * 100;
    if(num > 50){
        console.count("Greater than 50");
    }else{
        console.count("less than 50");
    }
}

 

 

 

posted @ 2016-05-16 15:37  Zhentiw  阅读(142)  评论(0)    收藏  举报