sum automatan in javascript
//summation automatan demo
//useful for building sequences or summation
var SummAutomatan = (function(){
function SummAutomatan(amount){
this.amount = amount;
this.next = null;
}
SummAutomatan.prototype.append = function(){
if(this.next === null){
this.next = new SummAutomatan(this.amount + 1);
}
else {
this.next.append();
}
};
return SummAutomatan;
})();