Today I was testing minify my code and I was in doubt about the conversion.
Original Code
Loader = (function(Configure){
var CurrentAction = null;
var loaded = [];
loader = function(){}
loader.prototype = {
check : function(action){
var _return = false;
if(CurrentAction == null || Configure.get('reload')){
loaded.push(action);
_return = true;
}
if(CurrentAction != action && loaded.indexOf(action) == -1){
loaded.push(action);
_return = true;
}
CurrentAction = action;
return _return;
}
}
return new loader();
}(Configure));
Minimized Code
Loader = function(e) {
var n = null,
r = [];
return loader = function() {}, loader.prototype = {
check: function(o) {
var u = !1;
return (null == n || e.get("reload")) && (r.push(o), u = !0), n != o && -1 == r.indexOf(o) && (r.push(o), u = !0), n = o, u
}
}, new loader
}(Configure);
Doubt
- How do you read this code with commas?
Addendum
I understand that it does not execute (r.push(o), u = !0)
if -1 == r.indexOf(o)
has already generated false
, but I do not understand when it executes what comes after the comma, n = o, u