Given a string containing just parentheses, determine if the input string is valid
The code looks quite succinct and sufficient. The only suggestions I would offer are minor tweaks:


for the imperative solution, a for...of loop could be used to eliminate the need to do bookkeeping on the counter variable and use it to index into the string to get each character:

for(const c of s) {
  if (par[c]) {
    rep.push(par[c]);
  } else {
  if (rep.pop() !== c) {
    return false;
  }
}

for the functional solution, the callback function could be declared on a previous line, and then the return line can be reduced to a single line:

const pushOrPopMatch = x =&gt; par[x] ? rep.push(par[x]) : rep.pop() === x
return [...s].every(pushOrPopMatch) &amp;&amp; !rep.length;


That line defining pushOrPopMatch() is 73 characters long, which some might argue is too long for a line, given it would be inside a function and indented at least two spaces, so it may not be ideal