Beginner Question


#1

Hello, I'm just a beginner interested in learning coding (Javascript). I have a question concerning the spaces between strings and such. Why do many people as I see online code with weird spacings between tasks performed for conditions? For example, why do people do this?: if ( 5 * 3 === 15 )
{
condition.log ( "Good day!" ) }
else
{
condition.log ( "Hello!" ) }

Instead of this?: if(5*3===15){condition.log("Good day!")}
else{condition.log("Hello!")}

Are there uses for these spaces in higher level coding? Regards, Paul


#2

Hi between the two there isn't a difference you could put space or not. Its up to you.


#3

They do that for readability - for the humans that will be reading that code.


#4

Is it clearer and easier to read?


#5

What do you think between: Which is easier for you to read considering you're likely to write long things with javascript. Do you really want one single continues line of code or spaced out so you can follow it line by line

or

also it's console.log not condition.log