bv0k0q
Last Updated: January 28, 2019
·
30.56K
· tmaster

Enter multiple lines in Chrome JS console.

Maybe many people already knew this, but just for those who don't.

After typing out the first line, instead of hitting enter, hit shift + enter. This will bring you the next line without executing the code. So when you are done, hit enter, it will execute all the code you just wrote.

Also a well known tip, you can bring up JS console in any tabs in the chrome developer tool by hitting ESC (e.g. Elements, Sources etc.).

2 Responses
Add your response

4277

@damienklinnert Yes, indeed. But I am not sure how long ago, the Chrome JS console did not support this.

over 1 year ago ·
28140

Thanks for useful info. Is there a possible way to reverse this behaviour? I mean, I want to write code using Enter to jump to the next line, and shift+enter to execute?

over 1 year ago ·