Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get last returned value from Chrome developer tools console

In some consoles (like python, ruby’s irb, or node) you can access the return value from your last statement with an underscore:

> 'Hello'
'Hello'
> _
'Hello'

Is there something similar in developer’s tool console for chrome, or firefox?

like image 558
Ulysse BN Avatar asked Jan 30 '17 01:01

Ulysse BN


People also ask

How do I see JSON response in Chrome Developer Tools?

Ctrl + Alt + click on arrow to auto expand objectTo expand node and all its children, press Ctrl + Alt + click. Basically, we are going to search in JSON but it is available in visible content that's why we are expanding all nodes.

How do I see console output in Chrome?

Console Logs in Chrome: In Google Chrome, the Console Logs are available as a part of Chrome Dev Tools. To open the dedicated Console panel, either: Press Ctrl + Shift + J (Windows / Linux) or Cmd + Opt + J (Mac).

What is $$ in Chrome console?

jQuery style DOM queries in the console The most popular API jQuery provides is the $ , used for selecting DOM elements. The Chrome dev tools console allows you to make use of that $ selector, and more. Under the hood, $ is an alias to document.


1 Answers

You can use $_ to get the last returned result.

> 'Hello'
"Hello"
> $_
"Hello"
like image 89
Villa7_ Avatar answered Sep 28 '22 10:09

Villa7_