This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Sandesh Rai
almost 10 years

console.log(myColor.length); //the code works without semi-colon..any difference

console.log(myColor.length) 

and

console.log(myColor.length);  

The both output seems same with or without semicolon. Is there any different meaning.

Answer 534411fd9c4e9d0a3c000ad1

2 votes

Permalink

No but it’s always best practice to end a statement (end of code) with a semicolon.

points
Submitted by Neil
almost 10 years

2 comments

Sandesh Rai almost 10 years

Thanks for you answer. But i am still sure that there has to be depth explanation about it.If it was just a practice to end a statement i wouldn’t bother to use semicolon. Don’t you think it’ll save time for the developers.