console.log()可以取代alert()或document.write(),在網(wǎng)頁腳本中使用console.log()時,會在瀏覽器控制臺打印出信息。 console.dir()可以顯示一個對象所有的屬性和方法。