String.prototype.startswith = function(s, from , to) { from = from || 0; to = to || 9999999; // Number.MAX_VALUE seems to bug with string.slice() s = typeof s == "string" ? [s] : s; for ( var n=0; n