Copy From the Console

##Problem I’m working on a problem right now where I get large amounts of data back from a function.

That data might not be correct.

I need to inspect it, so I log it to the console. Unforuntaly, I have to go through the nested array by hand. It’s not very fun.

Large nested array in the console.

Wouldn’t it be awesome if I could save that whole logged array and search it in a text editor?

##How to:

  1. Open your browser console.
  2. Right click on the logged object. Click "Store as Global Variable". ![Box showing the options for right click](/assets/images/2015/01/Screen-Shot-2015-01-23-at-4-55-45-PM.png) This saves the object to a temporary variable, which is returned in the console. ![Screenshot of temporary storage variable](/assets/images/2015/01/Screen-Shot-2015-01-23-at-4-56-16-PM.png)
  3. In my case, the temporary variable is named temp1. To copy it to the system-wide "clipboard", enter copy(temp1) in the console. ![Screenshot of copying storage variable](/assets/images/2015/01/Screen-Shot-2015-01-23-at-5-00-21-PM.png)
  4. Open your favorite text editor and paste (Cmd-V). ![5000 lines of code in sublime text editor](/assets/images/2015/01/Screen-Shot-2015-01-23-at-5-02-04-PM.png)
  5. </ol> ##So Much Data! As you can see in the screenshot above, there's a ton of data...almost 5000 lines! There's no way I could verify all of it myself. Now I have the data in a file and can write a quick script to do the checking for me.