Not sure why this construction of a class is not working, maybe I'm just calling the function in the wrong way? Here is my code:
function zeros(bits, pattern) {
this.bits = bits;
this.pattern = pattern;
};
zeros.prototype.short = function() {
return this.bits.match(this.pattern)[0].length;
};
heyJude = zeros('1100110011001100000011000000111111001100111111001111110000000000000011001111110011111100111111000000110011001111110000001111110011001100000011', /([0]).*?\1+/);
console.log(heyJude.short());