Function expression ending with ; vs. not
coding-style, javascript
Solution
At it's root, what you have there is an assignment statement, and according to the Google Javascript Style Guide, all statements should end in a `;`. Especially assignment statements. JSLint requires `;` or else it won't pass.
Problem
When reading others code I have seen functions written both ending with a semi-colon and not ending with a semi-colon. with: ``` var testFunction = function() { // magic happens here }; ``` without: ``` var testFunction = function() { // magic happens here } ``` - ?: Is one more "technically" correct than the other? - ?: Is there a speed advantage to one? - ?: Do browsers not care and so it's just a style bleeding over from another language or an old format that used to be required for JavaScript functions? - ?: #{question I hadn't considered to ask here but you think I should have} Update: I also found this very useful => https://developer.mozilla.org/en/JavaScript/Reference/Functions_and_function_scope