Saturday, 23 April 2022

copy array in console as json Angular

 https://stackoverflow.com/questions/10305365/javascript-chrome-how-to-copy-an-object-from-the-webkit-inspector-as-code

  1. Right-click an object in Chrome's console and select Store as Global Variable from the context menu. It will return something like temp1 as the variable name.

  2. Chrome also has a copy() method, so copy(temp1) in the console should copy that object to your clipboard.

    3.Note on Recursive Objects: If you're trying to copy a recursive object, you will get [object Object]. The way out is to try copy(JSON.stringify(temp1)) , the object will be fully copied to your clipboard as a valid JSON, so you'd be able to format it as you wish, using one of many resources.

    If you get the Uncaught TypeError: Converting circular structure to JSON message, you can use JSON.stringify's second argument (which is a filter function) to filter out the offending circular







No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...