Then, if we encounter the opposite/pairwise symbol, we can pop() it off so that we are no longer tracking that pair.
So visualize the processing like this:

xxxxxxxxxx10
const stack = [];​if (str[i] === "(" || str[i] === "[" || str[i] === "{") { stack.push(str[i]);} else { // if the top of the stack's pairwise symbol is the next character if (stack[arr.stack - 1] === map[str[i]]) { stack.pop(); } else return false;}OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

