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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#