-
Notifications
You must be signed in to change notification settings - Fork 10.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
Convert var to let & Convert Non-strict to strict equality checking #2904
Conversation
Avoid the more obscure equality algorithm used when using == / != and rely on the strict equality checking algorithm employed by === / !===
Deploy preview ready! Built with commit 1a42593 |
Deploy preview ready! Built with commit 1a42593 |
@@ -48,6 +48,6 @@ export default class SessionStorage { | |||
getStateKey(location, key) { | |||
const locationKey = location.key | |||
const stateKeyBase = `${STATE_KEY_PREFIX}${locationKey}` | |||
return key == null ? stateKeyBase : `${stateKeyBase}|${key}` | |||
return key === null ? stateKeyBase : `${stateKeyBase}|${key}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the logic as it's not now checking for undefined
https://stackoverflow.com/a/5515385/182702 If you want to use the strict equality check, could you also add a check for undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do, thanks @KyleAMathews
Thanks! |
No problem, glad to help. |
No description provided.