mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Copy Some Data From The Console as a chrome til
This commit is contained in:
@@ -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/).
|
||||
|
||||
_759 TILs and counting..._
|
||||
_760 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -55,6 +55,7 @@ _759 TILs and counting..._
|
||||
### Chrome
|
||||
|
||||
- [Access A Value Logged To The Console](chrome/access-a-value-logged-to-the-console.md)
|
||||
- [Copy Some Data From The Console](chrome/copy-some-data-from-the-console.md)
|
||||
- [Duplicate The Current Tab](chrome/duplicate-the-current-tab.md)
|
||||
- [Easier Access To Network Throttling Controls](chrome/easier-access-to-network-throttling-controls.md)
|
||||
- [Pretty Print Tabular Data](chrome/pretty-print-tabular-data.md)
|
||||
|
||||
20
chrome/copy-some-data-from-the-console.md
Normal file
20
chrome/copy-some-data-from-the-console.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copy Some Data From The Console
|
||||
|
||||
Sometimes you have some data that you are playing around with in the
|
||||
console, something you logged from an API response. You then want to share
|
||||
it, so you try to copy the whole thing into your system copy buffer. There
|
||||
are a couple hacky ways of doing this, but Chrome supports a really smooth
|
||||
way.
|
||||
|
||||
Use the `copy` function.
|
||||
|
||||
```javascript
|
||||
characters
|
||||
> (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
|
||||
copy(characters[1])
|
||||
```
|
||||
|
||||
My system copy buffer now contains the entire object that makes up the
|
||||
second entry in that list. I can then paste it into Slack or wherever.
|
||||
|
||||
[source](https://twitter.com/addyosmani/status/1092686766375616517)
|
||||
Reference in New Issue
Block a user