console.dir() 与 console.log() 区别
Difference
- console.logprints the element in an HTML-like tree
- console.dirprints the element in a JSON-like tree
Example

Specifically, console.log gives special treatment to DOM elements, whereas console.dir does not. 
This is often useful when trying to see the full representation of the DOM JS object.
SEE ALSO stackoverflow
 
                    
                
 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号