I dont understand the spacing in If-statements


#1

in exercise 14, It uses a very specific pattern of spacing. What is the use of this?

When I type: if("myName".length >= 5){console.log("You have a long name!");}

it wil log 'You have a long name!' to the console

so what is the use of typing:

if( "myName".length >= 5 ) {
console.log("You have a long name!");
}

This looks so complicated to me, but it has the same result.


#2

This way is neater & easier to read, so will be much better to continue in this manner


#3

But what is the use of this spacing?

if( "myName".length >= 5 ) {
console.log("You have a long name!");
}


#4

oh nevermind, thanks for replying!


#5