Check For Balanced Parentheses In Javascript, An input string is valid if: 1.