We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
for ... of ...
.forEach
Do we have a preference for if we use:
const array = [1, 2, 3, 4]; for (const item of array) { console.log(item); } // or array.forEach((item) => { console.log(item); });
There is an eslint plugin that enforces a style. The arguments are quite one-sided, but I agree with it.
I was inspired to ask by this bit of code https://github.com/loveholidays/aurora/blob/3a5223d3680c35c5a494f3526e14f728a018d416/src/apis/content-repository/ContentRepositoryApi.ts#L155
The text was updated successfully, but these errors were encountered:
Personally I don't see an issue with having both, but if I had to pick only one then I would keep .forEach
I think this is more like an imperative vs declarative argument, I vote for declarative
Sorry, something went wrong.
No branches or pull requests
Do we have a preference for if we use:
There is an eslint plugin that enforces a style. The arguments are quite one-sided, but I agree with it.
I was inspired to ask by this bit of code
https://github.com/loveholidays/aurora/blob/3a5223d3680c35c5a494f3526e14f728a018d416/src/apis/content-repository/ContentRepositoryApi.ts#L155
The text was updated successfully, but these errors were encountered: