isBalanced function for checking if string with brackets is balanced ([{}])
openBrackets can be a Set

openBrackets is only used to test if a character is an opening bracket. So, it can be declared like this:

const openBrackets = new Set(['(', '[', '{']);


and the test will become: 

if (openBrackets.has(arr[i])) { ... }


Use for...of to iterate

The for ... of syntax avoids having to work with indices, as in this case you don't need the i variable at all (except to dereference the correct character from arr). Furthermore, you can iterate the string directly, without having to .split('') it first:

for (let c of string) {
  if (openBrackets.has(c)) {
    open.push(c);
  } else if (closedBrackets[c] &amp;&amp; open.pop() !== closedBrackets[c]) {
    return false;
  }
}


Rename closedBrackets

Reading the name of this variable I would expect some sort of collection of brackets, not a mapping/correspondence between closing and opening brackets. Therefore, I would give it a different name. Something like bracketCorrespondence might work, although there might be some better names for it out there.

So, here's a version of the code with these suggestions applied:



const isBalanced = (string) =&gt; {
  let open = [];
  
  const openBrackets = new Set(['(', '[', '{']);

  const bracketCorrespondence = {
    ')': '(',
    ']': '[',
    '}': '{',
  };
  
  for (let c of string) {
    if (openBrackets.has(c)) {
      open.push(c);
    } else if (bracketCorrespondence[c] &amp;&amp; open.pop() !== bracketCorrespondence[c]) {
      return false;
    }
  }
  
  return !open.length;
}

console.log(isBalanced('') === true);
console.log(isBalanced('()') === true);
console.log(isBalanced(')()') === false);
console.log(isBalanced(')(') === false);
console.log(isBalanced('()(()()()())') === true);
console.log(isBalanced('[](){}') === true);
console.log(isBalanced('[({})]') === true);
console.log(isBalanced('[(]{)}') === false);
console.log(isBalanced('const sth = () =&gt; { animal.sleep();') === false);
console.log(isBalanced('const sth = { bark: animal() }') === true);