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;