-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Use arrow functions for anonymous functions where possible (part #8) #19191
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
@@ -594,7 +594,7 @@ Demo: [Device pixel presnap](https://kdashg.github.io/misc/webgl/device-pixel-pr | |||
On supporting browsers (Chromium?), `ResizeObserver` can be used with `'device-pixel-content-box'` to request a callback that includes the true device pixel size of an element. This can be used to build an async-but-accurate function: | |||
|
|||
```js | |||
window.getDevicePixelSize = window.getDevicePixelSize || async function(elem) { | |||
window.getDevicePixelSize = window.getDevicePixelSize || async (elem) => { |
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.
Need parens; this looks like a polyfill?
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.
I've added some parenthesis, hope it is correct.
files/en-us/web/api/webgl_api/webgl_model_view_projection/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/websockets_api/writing_websocket_server/index.md
Outdated
Show resolved
Hide resolved
…dex.md Co-authored-by: Joshua Chen <[email protected]>
…ex.md Co-authored-by: Joshua Chen <[email protected]>
…ex.md Co-authored-by: Joshua Chen <[email protected]>
…ex.md Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
1b6c560
to
efe3edb
Compare
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.
All boxes are ticked on my end—LGTM!
Arrow functions are shorter and easier to read (but doesn't bind
this
).