-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Typo in Note 1 of Array.prototype.lastIndexOf #3314
Comments
Confirmed. This is probably an error from trying to copy the prose from the analogous note in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The last sentence of Note 1 in Array.prototype.lastIndexOf reads:
If the computed index is less than or equal to +0𝔽, -1𝔽 is returned.
If I understand it correctly it should be instead:
If the computed index is less than +0𝔽, -1𝔽 is returned.
If e.g. the length of the array is 2 and the optional fromIndex is -2 the computed index would be 0 and the loop at step 8 executes once comparing searchElement with the first element of the array, potentially returning 0 if they are the same according to the IsStrictlyEqual algorithm.
The text was updated successfully, but these errors were encountered: