Store as Global Variable option in Chrome Developer Tools (Chrome 37)

David Calhoun · 7K views · 2014 · 0:26

Open on YouTube

Testing, debugging & developer toolsWeb developmentdemodated

Why Stack Overflow recommends it

Stack Overflow users link it as a quick visual proof of how to grab a logged object into a global variable in the Chrome console.

Recommended by 1 people across 1 different months, 2014 to 2015.

What it is

A 26-second screen recording by David Calhoun showing the "Store as Global Variable" option in Chrome Developer Tools (Chrome 37). It demonstrates right-clicking a logged object in the console and saving it to a variable such as temp1.

What people said

Recommends David Calhoun · 2014-06 · Stack Overflow · on “Copy an object from the webkit inspector as code”

You can now accomplish this in Chrome by right clicking on the object and selecting "Store as Global Variable": [this video] [LINK]

Cites LJᛃ · 2014-09 · Stack Overflow · on “Chrome Javascript Console - Reference to object output with console.log(obj)?”

Right-click on the console log output and choose the option "Store as Global Variable". The console will display the name of the variable it has been saved to, such as temp1 , temp2 , etc. which you can then refer to in console commands. Here [this video] is a video of it (not created by me).

Cites sdr · 2015-01 · Stack Overflow · on “Access last logged value in Chrome console”

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) [this video] .