The function of the semicolon at the beginning of the line is to successfully concatenate a new code when the previous one does not include the ";" in the end.
var n = a + b
(c + d).print()
Without the comma, the second line would have been interpreted as a function call. Home
The system would interpret as follows:
var n = a + b(c + d).print();
Note that the variable "b" would be interpreted as a function, returning the following error:
ReferenceError: b is not defined
In conclusion, it is good practice to always terminate a statement with the ";", but when a line starts with parentheses it is also good practice to precede it with ";", especially when we need to change third party code. p>
;(c + d).print()