Beginner Question


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!" ) }
condition.log ( "Hello!" ) }

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

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


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


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


Is it clearer and easier to read?


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


also it's console.log not condition.log