noname122,
не проверял, но логика примерно такая ...
function validate(mF) {
myForm = mF;
var ima = textValid(myForm.ima.value, myForm.vIma);
var fam = textValid(myForm.family.value, myForm.vFam);
var login = loginValid(myForm.login.value);
var pass = passValid(myForm.pass1.value);
var people = JSON.parse(window.localStorage.getItem("people") || "[]");
if (ima && fam && login && pass) {
var i = myForm.ima.value,
f = myForm.family.value;
var index = people.findIndex(a => a.i == i && a.f == f);
if (index == -1) {
alert("о новенький!");
people.push({
i,
f
});
window.localStorage.setItem("people", JSON.stringify(people))
} else {
alert(`Привет ${i} ${f}`);
}
}
return ima && fam && login && pass;
}