Temir Aliev
asked on
What is going on on line 1 and 2? Why didn't we write anything inside the curly braces on line 2?
var SequenceSum = (function() {
function SequenceSum() {}
SequenceSum.showSequence = function(count) {
var holder = [];
for ( var i = 0; i <= count; i++){
holder.push(i);
}
var a = holder.reduce(function(a, b){
return a + b;
})
return a;
};
return SequenceSum;
})();
console.log(SequenceSum.showSequence(6))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER