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
Types & Grammar - Chapter 2 : TypeError while reversing a string. #1281
Comments
I think the difference is you're running the code in strict mode. |
Nope. It throws the error regardless of strict mode. |
Shrugs. This must have changed at some point. It used to silently ignore the attempt to assign to the read-only string when I wrote the book. I think what may have changed is the treatment of values that are passed through as |
Note that the section in question is accurate in that it says |
That's what I was trying to say. It's just the commented lines that need to be changed. :) |
https://github.com/getify/You-Dont-Know-JS/blob/master/types%20%26%20grammar/ch2.md#strings
There's a code in this section that tries to use the Array.prototype.reverse function to reverse a string.
The comment says that it returns a String object wrapper. However, running it on Chrome 66 (and maybe other browsers too) gives a TypeError.
The text was updated successfully, but these errors were encountered: