码迷,mamicode.com
首页 > 编程语言 > 详细

[Javascript] Grouping and Nesting Console Log Output

时间:2016-05-16 16:59:03      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

Organize your log output by grouping your logs into collapsable hierarchies using console.group().

 

for(var i = 0; i < 100; i++){
    var num = Math.random() * 100;
    console.groupCollapsed("Picking a random number!");
    console.log("Number greater than 10?", num > 10);
    console.log("Number greater than 50?", num > 50);
        console.groupCollapsed("This is a nested log group");
        console.log(i);
        console.groupEnd();
    console.groupEnd();
}

 

技术分享

[Javascript] Grouping and Nesting Console Log Output

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5498230.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!