DEV Community

Discussion on: JS Coding Question #10: Is Balanced Parenthesis [Very Common Question]

frontendengineer profile image
Let's Code Author • Edited on

thanks Jay for the snippet and taking time for the explanation you have here.
PS: I like your solution also the return stack.length === 0

5 years ago, I feel the same thing about adding semi-colon everywhere but now I have been coding without it. This might be one of those preference just like spaces and tabs. We all use a build tool and small modules might help that we do not have to worry about ASI mistakes taking place.

If change of heart on this preference, a team can incorporate prettier and it will address semi-colon concerns easily.