After entering the first line, instead of pressing enter, press shift + enter. This will lead to the next line without code execution. So when you are done, press enter, it will execute all the code you just wrote.
Also known tip, you can invoke the JS console on any tabs in the Chrome developer tool by pressing ESC (e.g. Elements, Sources, etc.).
source
share