Skip to content

Ignore simple sum in no-array-reduce #1348

@fisker

Description

@fisker

I still think

foo.reduce((total, element) => total + element.bar, 0);

should be preferred over

let total = 0;
for (const element of foo) {
	total += element.bar;
}

Especially, where reduce is not an expression, like this case

if (foo.reduce((total, element) => total + element.bar, 0) > 100) {};

Or at least allow to ignore it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions