Last Updated: February 25, 2016
·
432
· ashokraj

In Javascript/Jquery use ';' more to avoid errors/confusions

JavaScript is a very flexible and mysterious language.
Sometimes when we use lots of inner functions & library calls,
such as

$('#div').click(function(){  //code
});
(function (){ //code
 });

we can just put a ";" before like,

;(function (){ //code
 });

just to avoid errors & confusion as the code gets bigger, we won't have any idea where we are missing ";".