Reputation: 2481
In Chrome developer tools' JavaScript console as well as in Firebug's we can access the result of the last evaluated expression via $_
.
Is there a way to access the second/third/... last result? I am interested in answers for both Chrome DevTools and Firebug.
Upvotes: 5
Views: 2251
Reputation: 349
This is an old question, so I do not know if this was an option, but now with Chrome and Firefox (for any object) you can do something similar to this.
Be mindful that clicking on the space outside the object representation, even on the same line, will open a different menu.
Upvotes: 4
Reputation: 20105
The simple and unfortunate answer is no, there is no way to access the value of the second/third/... last evaluated expression.
See Chrome's Command Line API documentation as well as Firebug's documentation.
Only the inspected elements have a history like that. That means, you can access the second-last inspected element via $1
, the third-last one via $2
and so on.
Upvotes: 5