From 997ce038e1c5e29924fa1e16afa963d5684f26a0 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 29 Aug 2017 16:39:34 -0500 Subject: [PATCH] Add Access A Value Logged To The Console as a chrome til --- README.md | 3 ++- chrome/access-a-value-logged-to-the-console.md | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 chrome/access-a-value-logged-to-the-console.md diff --git a/README.md b/README.md index 2477bac..17fe005 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_552 TILs and counting..._ +_553 TILs and counting..._ --- @@ -48,6 +48,7 @@ _552 TILs and counting..._ ### Chrome +- [Access A Value Logged To The Console](chrome/access-a-value-logged-to-the-console.md) - [Pretty Print Tabular Data](chrome/pretty-print-tabular-data.md) - [Reference The Selected Node](chrome/reference-the-selected-node.md) - [Simulating Various Connection Speeds](chrome/simulating-various-connection-speeds.md) diff --git a/chrome/access-a-value-logged-to-the-console.md b/chrome/access-a-value-logged-to-the-console.md new file mode 100644 index 0000000..14c7449 --- /dev/null +++ b/chrome/access-a-value-logged-to-the-console.md @@ -0,0 +1,17 @@ +# Access A Value Logged To The Console + +Did your app just log an object to the dev tools console and you'd like to +interact with that object? It's not straightforward, but you can do it. + +Assuming you already have dev tools opened to the _console_ tab, right click +on the value that has been logged to the console. Select the _Store as +Global Variable_ option. This will re-log the value assigning it to the +`temp1` variable. + +You can now reference that object as `temp1` accessing its values and +calling functions. + +You can even do this with multiple logged values, each subsequent one will +be assigned incrementing variable names: `temp2`, `temp3`, etc. + +[source](https://stackoverflow.com/questions/15895579/access-last-logged-value-in-chrome-console)