If you want to write multiple lines of commands in the Chrome console, first open the console (CMD + Shift + J on Mac / CTRL + Shift + J on Windows). Now while inside the Console, write any line of code, and then hold down Shift + Enter.
Now you can write on the new line without executing the previous line (as you do when you don’t hold down shift). When you want to run all your code, hit Enter at the end of your script (last line of code).