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 ";".
Written by Ashok Raj
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Coding
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#