TicTacToe solver in JavaScript
you can simplify this block a little:

for (let row of board) {
    for (let char of row) {
         map[counter] = char;
         counter++;
    }
}


into:

const map = board.flat();

You can generate matches pseudo-automatically which simultaneously improve readability

function generateMatches() {
     function simpleRange(upTo) {
          return new Array(upTo).fill(true).map((_, index) =&gt; index);
     }

     function customRange(start, step, length) {
          return simpleRange(length).map(index =&gt; start + index * step);
     }

     function horizontalRow(top) {
          return customRange(3 * top, 1, 3);
     }

     function verticalRow(left) {
          return customRange(left, 3, 3);
     }

     function progressingDiagonal() {
          return customRange(0, 4, 3);
     }

     function regressingDiagonal() {
          return customRange(2, 2, 3);
     }

     const matches = [];
     for (let top = 0; top &lt; 3; ++top) {
          matches.push(horizontalRow(top));
     }
     for (let left = 0; left &lt; 3; ++left) {
          matches.push(verticalRow(left));
     }
     matches.push(progressingDiagonal());
     matches.push(regressingDiagonal());
     return matches;
}




  Warning! I assumed starting at 0 index



Don't use console.log(...); in solve function. Try to return list of matches instead and use user interface API outside of it. It will allow you to write some automatic (for instance unit) tests for your code (using Motcha, Jasmine, etc... depending on your target technology)
General advices:


Use better names for variables: map -> flatBoard, arr -> row, arr2 -> reducedRow
Split your code into smaller functions for each step, for instance:

const arr2 = [...new Set(arr)].join("");


into:

function reduceRow(array) {
     return [...new Set(array)].join("");
}
const reducedRow = reduceRow(row);


Your original question is about performance. Let just start it now:


IMHO you don't need to convert Set into array into string to test its size. Use something like this instead: 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size

function rowDiversity(array) {
     return new Set(array).size;
}
const rowDiversity = rowDiversity(row);

Not sure if destructuring operator is needed at all at previous line too (most likely its performance impact is already neutral) But I would write this instead anyway:

function fetchRow(flattenBoard, match) {
     return match.map(index =&gt; flattenBoard[index]);
}
const row = fetchRow(flattenBoard, match);