alert('Hello from code1');
alert('Hello from code2');
There is no practical difference. Some people prefer one way over the other, similar to the preference for putting opening braces on the same line or the next line, or tabs vs spaces, or writing
x=1+2 instead of
Extra parentheses can add clarity, or clutter, depending entirely on style preference.