Skip to content
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

infra(unicorn): no-array-for-each #2461

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 10, 2023

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Oct 10, 2023
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 10, 2023
@ST-DDT ST-DDT requested review from a team October 10, 2023 08:33
@ST-DDT ST-DDT self-assigned this Oct 10, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 10, 2023

I'm not sure about this one.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #2461 (32b8329) into next (6cb5aa2) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2461      +/-   ##
==========================================
- Coverage   99.58%   99.58%   -0.01%     
==========================================
  Files        2823     2823              
  Lines      255529   255518      -11     
  Branches     1106     1104       -2     
==========================================
- Hits       254478   254464      -14     
- Misses       1023     1026       +3     
  Partials       28       28              
Files Coverage Δ
src/modules/datatype/index.ts 100.00% <100.00%> (ø)
src/modules/system/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer for..of loops over Array.prototype.forEach. It make the code more consistent as you can use for..of for all iterables and not only arrays. Additionally, I've read some time ago that they were supposed to be more performant, but according to this StackOverflow comment this is no longer the case. Last argument I can bring for the for..of loop is that you dont leave the this scope. This resolves potential issues with hoisting or this-binding.

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer for..of loops over Array.prototype.forEach. It make the code more consistent as you can use for..of for all iterables and not only arrays. Additionally, I've read some time ago that they were supposed to be more performant, but according to this StackOverflow comment this is no longer the case. Last argument I can bring for the for..of loop is that you dont leave the this scope. This resolves potential issues with hoisting or this-binding.

@ST-DDT ST-DDT merged commit 201d6e3 into next Oct 11, 2023
20 checks passed
@ST-DDT ST-DDT deleted the infra/unicorn/no-array-for-each branch October 11, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants