Access last logged value in Chrome console

Robin Drexler picture Robin Drexler · Apr 9, 2013 · Viewed 22k times · Source

When I evaluate an expression directly in the Chrome Console like

1 + 1

then I can reference to the evaluated value using

$_

enter image description here

However, I can't access the value with $_, when the value is a result of a console.log, coming from inside of my application, instead of an expression I typed directly into the console.

enter image description here

Is there a way to access the last evaluated expression, regardless where it came from?

Answer

sdr picture sdr · Jan 30, 2015

After it's been logged to the console, you can right click on it and get an option to Store as global object. Clicking this will define a new variable like 'temp1' which will point to the variable. Here's a video of it in action (not mine).