1, 顯示資訊
console.log('hello'); //普通訊息
console.info('資訊');//提示資訊
console.error('錯誤');//錯誤資訊
console.warn('警告');//警示資訊
複製程式碼

function fun () {
console.count('fun被執行的次數:') // 列印出來次數1, 2, 3
}
fun() // 執行函式
複製程式碼

console.log('第一組第一條: 1-1')
console.log('第一組第二條: 1-2')
console.groupEnd()
console.group('第二組資訊')
console.log('第二組第一條: 2-1')
console.log('第二組第二條: 2-2')
console.groupEnd()
複製程式碼

console.profile('控制檯計時器開始')
for (var i = 0; i < 100; i++) {
// console.log(i)
}
console.profileEnd()
複製程式碼
4, 檢視物件資訊:
let obj = {
blog: 'http://',
phone: 13111111111,
message: 'console.dir()可以顯示一個物件所有的屬性和方法'
}
console.dir(obj)
複製程式碼
