The console.dir() is used to display an interactive list of the properties of the specified JavaScript object as JSON.
console.dir()
const user = { name: "John", id: 1, city: "Delhi" }; console.dir(user);
The user object displayed in JSON representation