How can I assign a JavaScript object to a variable which was printed using console.log
?
I am in Chrome console. With Ruby I would use test = _
to access the most recent item printed.
If you want to do this to an object that has been already logged (one time thing), chrome console offers a good solution.
Hover over the printed object in the console, right click, then click on "Store as Global Variable". Chrome will assign it to a temporary var name for you which you can use in the console.