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
$_
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.
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:
- Click over the result with right button
- Save as global variable
- 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