Tuesday 25 August 2020

How to show full object in Chrome console?

Hello Friends,  

In this article, I will explain How to show the full objects in Chrome console?

In the last week, I was working with one angular project where i want to show the full object in chrome console.


I used console.log but it was not showing full object in Chrome console




Solution:

Use console.dir() to output a browse-able object . Prints a JavaScript representation of the specified object. If the object being logged is an HTML element, then the properties of its DOM representation are printed [1]

In *most* cases, console.log is the method you'd want to use to log something into the console. In some cases, however, console.dir can come a little more handy!

With console.dir, you can explore a regex's properties. When working with DOM elements console.log will display an HTML nested structure, compared to console.dir which will treat them as objects.

console.dir(object);
OR
console.log(JSON.stringify(object))


Prints a JSON representation of the specified object.



Example:



console.dir() should be used to get more information like prototype etc in arrays and objects.

Hope this helped you to solve your error
Happy Programming!!
Don’t forget to leave your feedback and comments below!
If you have any query mail me to Sujeet.bhujbal@gmail.com     
Happy programming!!
Don’t forget to leave your feedback and comments below!
Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------

3 comments:

  1. Thank you for writing this informative post. High Technologies Solutions providing best coaching classes in south delhi.Otherwise If any one who want to learn dot-net contact us on 9311002620 or visit:- https://htsindia.com/Courses/microsoft-courses/dotnettraininginstituteinsouthdelhi

    ReplyDelete
  2. Great articles, first of all Thanks for writing such lovely Post! Other wise If any one who want to learn dot-net contact us on 9311002620 or visit:- https://htsindia.com/Courses/microsoft-courses/dotnettraininginstituteinsouthdelhi

    ReplyDelete
  3. I haven't encountered this issue yet because all of my presentations have always been supported by Coursework Writing Services experts. But still I want to say thank you for for writing this much informative post.

    ReplyDelete