Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] House Password by jdent
"use strict";
const checks = [
/[a-z0-9]{10}/i,
/[A-Z]/,
/[a-z]/,
/[0-9]/,
];
function housePassword(data){
return checks.reduce((success, check) => {
return success && check.test(data);
}, true);
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(housePassword("A1213pokl"), false, "1st example");
assert.equal(housePassword("bAse730onE4"), true, "2nd example");
assert.equal(housePassword("asasasasasasasaas"), false, "3rd example");
assert.equal(housePassword("QWERTYqwerty"), false, "4th example");
assert.equal(housePassword("123456123456"), false, "5th example");
assert.equal(housePassword("QwErTy911poqqqq"), true, "6th example");
}
June 5, 2017