console.log
- console.log(obj1 [, obj2, ..., objN);
- console.log(msg [, subst1, ..., substN);
- console.log('String: %s, Int: %d,Float: %f, Object: %o', str, ints, floats, obj)
- console.log(
temp的值为: ${temp}
)
console.log('123456')
console.log('debug-->', 'response failed')
console.log(1, 'messgae')
console.log(2, 'messgae')
输出
123456
debug--> response failed
1 messgae
2 messgae
console.time
console.timeLog
console.timeEnd
console.time('aTimer');
setTimeout(function () {
console.timeLog('aTimer');
}, 1000);
setTimeout(function () {
console.timeEnd('aTimer');
}, 2000);
输出
aTimer: 1005ms
aTimer: 2009ms
更多Console使用可以参考MDN
https://developer.mozilla.org/zh-CN/docs/Web/API/console
网友评论