Update
Looks like browsers are starting to support copy natively in JS
In the console windows of both Chrome and Firefox on Mac I can
Here you can see the reference copy command of Chrome Dev tools: https://developers.google.com/web/tools/chrome-devtools/console/utilities#copy
You shouldn't use this commands on real JS cross-browsers (just for debugging on the console so-to-speak).