Why is this code valid

Why is this code valid

What is the actual use of semicolon?

·

1 min read

Weird code snippet Although this code looks really weird but its 100% valid and works perfectly. That is because if you use semicolon that just indicates end of a statement and a statement can be empty as well so ;; just means two empty statement. Likewise you can have as many semicolon as you want and it wont effect you output.