I'm trying to create a function to return the number of identical characters in 2 strings you provide.

```
  let [string1, string2] = target.split(",").map(p => p.trim());
  let [length, char1, char2] = "";
  let total = "0";
  if (!string1 || !string2) return this.errorReply(`Please provide two words or sentences separated by a comma.`);
  if (string1.length > string2.length) {
    length = string1.length;
  } else {
    length = string2.length;
  }
  let i;
  for (i = 0; i < length; i++) {
    char1 = string1.charAt(i);
    char2 = string2.charAt(i);
    if (char1 === char2) total++;
  }
  return this.sendReply(`|html|These two strings have <b>${total}</b> characters in common.`);

```

This is what I had so far, but this checks to see if the first character equals the first, second character equals the second, etc.
I need it to basically take the 1st character of the 1st string, and check to see if it's the same as ANY of the characters in the 2nd string, and once it's checked all of them, it moves onto the 2nd character of the 1st string and repeats. Any help on how I would do this?