-1

Does anybody know how to take the last thing (or recent thing) that was outputted by Chrome console into a local variable.

There was a very simple way to do this.

And this makes it quite easy, for example, to navigate through nested data and then taking that navigation into your code.

Andrew Chung
  • 417
  • 4
  • 15

1 Answers1

0

Here is how, in case helpful to anybody in the future.

STEP 1: Identify the data you want to put into a variable

Data in console

STEP 2: Right click on the data and click "Store object as global variable"

Right click

STEP 3: This new variable will be outputted in the next line. Usually temp1

temp1

STEP 4: Now use the dot notation to navigate through the data.

You can use this variable as you wish; I use dot notation to navigate through the data. This helps in case, I need to navigate through data or array in code and I want to confirm that I am doing it correctly.

Example of navigating through the data

Andrew Chung
  • 417
  • 4
  • 15