Access last logged value in Chrome console

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?


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).


Just follow these steps:

  1. Click over the result with right button
  2. Save as global variable
  3. copy(temp1)

You can only copy & paste.

See all available commands and shortcuts:

https://developers.google.com/chrome-developer-tools/docs/commandline-api https://developers.google.com/chrome-developer-tools/docs/shortcuts