Semicolon on jQuery

javascript, jquery

Solution

JavaScript doesn't actually require semicolons. That's just convention.

http://inimino.org/~inimino/blog/javascript_semicolons

I recommend using semicolons, just like I'd recommend indenting your code.

Problem

The following jQuery works with or without a semicolon after the function. Why? ``` jQuery(document).ready(function(){ jQuery("#red").treeview({ animated: "fast", collapsed: true, control: "#treecontrol", persist: "cookie" }) }); ``` It works on all browsers. Wouldn't this cause an error?

Original source