If there is an output in the chrome/safari webkit inspector containing an object that prints out such as:

Only much more complicated with loads of nested objects (which is why a copy/paste wont do)
Is there a way to put this in a variable to inspect in further and process it after its been printed on the console (its printed via console.log), just only after its already in the console?
$_ will give you last output of console. So in console you can assign in to a variable.

Note that you can do this only in console and not from your own code.
Here's a way to do it without wrapping console.log in a custom log function:
var justLogged;
var oldLog = console.log;
console.log = function () {
oldLog.apply(console, arguments);
justLogged = arguments;
};
console.log('test');
// if necessary, restore console.log to its original behavior when you're finished with it
console.log = oldLog;
The value of justLogged will be ['test'], since you just logged it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With