How to Copy Long Console Log in Google Chrome

When debugging JavaScript, you may come across situations where you have printed out some super-long variable which Chrome console doesn’t fully show. In order to retrieve the full variable, right-click the output, click Store as Global Variable. A variable name will appear at the bottom of the console together with the value you desire. Let’s assume the variable name is temp1. Execute the following command in the console:

copy(temp1);

That’s it! The value is now in your clipboard and can be pasted into an editor of your choice.