-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: use const consistently #4147
Conversation
LGTM |
1 similar comment
LGTM |
Why setting |
@@ -164,7 +164,7 @@ Returns emitter, so calls can be chained. | |||
Removes a listener from the listener array for the specified event. | |||
**Caution**: changes array indices in the listener array behind the listener. | |||
|
|||
var callback = function(stream) { | |||
const callback = function(stream) { | |||
console.log('someone connected!'); | |||
}; |
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.
Maybe just use a function... definition? here. (I forget if that's the correct term or not...)
LGTM with @Fishrock123's suggestion |
events.markdown uses `var` and `const` in different places seemingly arbitrarily. This change makes it favor const when possible.
OK, changed that |
|
Did a quick search, lots of In the same vein, one could say this change here is unnecessary, so I think I'll have to redact my LGTM. |
@silverwind The reason why I did it for this doc in particular is that there were conflicting examples. Well, not really conflicting, but inconsistent. One used |
(I'd be just as happy to convert the existing |
(One argument for |
I actually find that last argument (strict mode) compelling and am closing this PR. |
events.markdown
usesvar
andconst
in different places seeminglyarbitrarily. This change makes it favor
const
when possible.