The difference between console.log() and console.dir()

They all have the function of printing

console.log(): only print a toString representation

console.dir(): print out all the properties and methods of an object,

        let h1 =  document.querySelector("h1")
        console.log(h1,"console.log");
        console.dir(h1,"console.dir");

Guess you like

Origin blog.csdn.net/weixin_47745553/article/details/128271002