twn39 / code

:memo: 代码笔记,通过 issue 的方式记录日常遇到的问题和学习笔记
13 stars 1 forks source link

chrome devtools #24

Open twn39 opened 9 years ago

twn39 commented 9 years ago

chrome开发工具功能

twn39 commented 9 years ago

console.table()

console.table([{a:1, b:2, c:3}, {a:"foo", b:false, c:undefined}]);
console.table([[1,2,3], [2,3,4]]);

default

twn39 commented 9 years ago

color

console.log('%c OK, you are here, now.', 'background-color:#002f2f;color:#e6e2af')

default

twn39 commented 9 years ago

计算时间:console.time()

console.time("Array initialize");
var array= new Array(1000000);
for (var i = array.length - 1; i >= 0; i--) {    
    array[i] = new Object();
};
console.timeEnd("Array initialize");

default