Skip to main content
InterviewHubPRO
Section Overview
Q377

Question 377 of 536

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

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

What is the purpose of dir method of console object

senior LevelCode ExampleAsync & PromisesEvent LoopHTTP & REST APIs

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