Skip to content

Comments

Use arrow functions for anonymous functions where possible (part #8)#19191

Merged
Josh-Cena merged 71 commits intomdn:mainfrom
teoli2003:function-arrow-8
Aug 8, 2022
Merged

Use arrow functions for anonymous functions where possible (part #8)#19191
Josh-Cena merged 71 commits intomdn:mainfrom
teoli2003:function-arrow-8

Conversation

@teoli2003
Copy link
Contributor

Arrow functions are shorter and easier to read (but doesn't bind this).

@github-actions github-actions bot added the Content:WebAPI Web API docs label Aug 5, 2022
@github-actions

This comment was marked as resolved.


```js
window.getDevicePixelSize = window.getDevicePixelSize || async function(elem) {
window.getDevicePixelSize = window.getDevicePixelSize || async (elem) => {
Copy link
Member

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?

Copy link
Contributor Author

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.

@teoli2003 teoli2003 requested review from Josh-Cena and removed request for wbamberg August 8, 2022 12:01
Copy link
Member

@Josh-Cena Josh-Cena left a 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!

@Josh-Cena Josh-Cena merged commit fa3fe2e into mdn:main Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants