-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string[index] doesn't work correctly #16
Comments
The problem here is that ES6 block scoping isn't implemented yet, so the const applies to the whole function, and the assignment silently fails. Fixing #15 will make this more obvious. |
I think there's bug somewhere, because when the program is in ES5, it doesn't work as expected:
|
What is the expected output? I get:
|
I've just try running with the demo site again: The output looks good now. So it was because of the |
See the line
console.log(string, i, char)
below in the program to check if parentheses are balanced:Expected output:
Actual output:
It seems that in this program
string[index]
always returns the first character.The text was updated successfully, but these errors were encountered: