Search code examples
javascriptjsongoogle-chromedevtools

Chrome DevTools: How to copy a JSON object as text from the Sources tab or Watch pane


I'm stepping through my page's javascript with Chrome DevTools, I've put a watch on my variable. I just need the JSON object as text.


Solution

  • You can print your object in the following way in your code:

    console.log(JSON.stringify(your_object));