blob: 764027ebb4e1af5142ba763a1f1a9feb9d9d0e72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
var numberLogger = function(name,length){
this.name=name;
this.ns = new Array(length);
this.len = length;
for (i=0;i<length;++i)
this.ns[i] = 0;
}
numberLogger.prototype.add = function(x) {
this.ns.splice(0,1);
this.ns.push(x);
}
numberLogger.prototype.stringify = function() {
return {"name":this.name,"dat":this.ns,"len":this.length};
}
module.exports = numberLogger;
|