Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does three semicolons in a javascript expression do?

I've seen a triple semicolon in a few expressions here and there.
Does it have any logical effect?

The closest thing I've seen for an explanation is that it tells the Dean Edwards compressor to ignore that line.

;;; var someVar = 'Rebel';
like image 550
Chase Wilson Avatar asked Jul 16 '10 20:07

Chase Wilson


People also ask

What is the purpose of semicolons in JavaScript statements?

Semicolons are an essential part of JavaScript code. They are read and used by the compiler to distinguish between separate statements so that statements do not leak into other parts of the code.

What is the use of semicolon in JavaScript Class 10?

Semicolons in JavaScript are optional. In JavaScript, there is a process called Automatic Semicolon Insertion (ASI) which inserts a Semicolon whenever needed but not placed. Semicolons are also used to terminate the statements.


2 Answers

It makes people ask questions on StackOverflow.

Other than that, it does nothing.

like image 192
Joey Adams Avatar answered Oct 18 '22 21:10

Joey Adams


Nothing. Absolutely nothing.

Three semicolons, ten semicolons, a hundred semicolons, they all get interpreted to the same result: nothing.

like image 41
Jacob Relkin Avatar answered Oct 18 '22 21:10

Jacob Relkin