Question: what is the difference between console.log and console.dir?
Answer: In simple words, the console. log() returns the object in its string representation and console. dir() recognizes the object just as an object and outputs its properties. Both log() and dir() returns the string just as a string.