We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 890180c + fa3d96b commit f06c85cCopy full SHA for f06c85c
src/js/others/balanced-symbols.js
@@ -11,7 +11,7 @@ export function parenthesesChecker(symbols) {
11
let top;
12
13
while (index < symbols.length && balanced) {
14
- symbol = symbols.charAt(index);
+ symbol = symbols[index];
15
if (opens.indexOf(symbol) >= 0) {
16
stack.push(symbol);
17
} else if (stack.isEmpty()) {
@@ -24,8 +24,5 @@ export function parenthesesChecker(symbols) {
24
}
25
index++;
26
27
- if (balanced && stack.isEmpty()) {
28
- return true;
29
- }
30
- return false;
+ return balanced && stack.isEmpty();
31
0 commit comments