I usually see this:
Scene_MiniMap.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this);}; <<< ;But this also works just fine:
Scene_MiniMap.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this);} // <<< removed ;What's the difference? Which one is better and why?
JavaScript has ASI (Automatic Semicolon Insertion), the set of rule where ASI applies are not exactly straightforward for someone that start using JS,
it's possible to avoid semicolon in most cases, basically the rule is that if the parser can understand you intended to break the line there for a reason it inserts the semicolon;
If the new line can continue the previous one then you have a trouble,
mostly this means that if you always use brackets {} you just have to avoid starting a line with a ( or a [ to be safe, for example:
(function(){ // ...})['a','b','c].forEach(function(){ // ...})is probably not what you want as the first function expression is followed by a sequence expression (a sequence of stuff with comma, this means that everything between comma gets executed and the last value is returned), so at some point your JS will look like this for your interpreter:
(function(){})['c'].forEach(function(){})so JS will try to see if function(){} has a 'c' property and if so it will evaluate it, then try to run forEach on the result.
let's suppose you have something like
Function.prototype.c = [1,2,3];
before that expression this means that JS will manage to execute the forEach but on the 1,2,3 sequence instead of the 'a','b','c' that you would expect
so bottom line, put semicolon where needed, if not sure put semicolon at the end of any line that can end with semicolon until you get the rule better,
however when working in project where semicolon everywhere is agreed just stick to the rule
EDIT:
this site seems to have the ruleset explained better (and explains the possible pitfalls as well):
http://inimino.org/~inimino/blog/javascript_semicolons