JavaScript to check if string has at least three characters that are in another variable
Combining .split() with .filter() you can trasform activeUserName in array and filter each char against the string manager1:
var activeUserName = "JohnDoe100";
var manager1 = "JYZALoe999";
var howMany = activeUserName.split('').filter(function(e, i, a) {
return (manager1.indexOf(e) != -1);
}).length;
console.log('The number of chars in common is: ' + howMany);
var activeUserName = "JohnDoe100";
var manager1 = "JYZALoe999";
const arr1 = [...activeUserName];
const arr2 = [...manager1];
let count = 0;
for (let i = 0; i<arr1.length; i++) {
if (arr2.indexOf(arr1[i]) !== -1) count++;
}
if(count >= 3)
console.log(`string b 3 same values of string b`);