InterviewHubPRO
Section Overview
Q377

Question 377 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

72%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

What is the purpose of dir method of console object

The console.dir() is used to display an interactive list of the properties of the specified JavaScript object as JSON.

javascript
  const user = { name: "John", id: 1, city: "Delhi" };
  console.dir(user);

The user object displayed in JSON representation

Screenshot