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

Js best practice violation #4

Closed
yosefHesham opened this issue May 9, 2022 · 0 comments
Closed

Js best practice violation #4

yosefHesham opened this issue May 9, 2022 · 0 comments

Comments

@yosefHesham
Copy link
Owner

static clearCompletedTasks() {
this.todos = this.todos.filter((e) => !e.completed);
for (let i = 0; i < this.todos.length; i += 1) {
this.todos[i].index = i + 1;
}
this.#incrementor = this.todos.length;

its best to execute only one thing in the function, so its better to execute that loop into another function and call it .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant