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

JavaScript best practices. #4

Open
CindyDorantes opened this issue Jul 18, 2022 · 0 comments
Open

JavaScript best practices. #4

CindyDorantes opened this issue Jul 18, 2022 · 0 comments

Comments

@CindyDorantes
Copy link
Owner

  • There are several functions in the class-task.js file, You could improve the readability moving code to new modules.
  • You could use conditional shorthands for the folloing lines of code inside class-task.js;
    if (this.completed === true) {
    taskCheck.checked = true;
    }

    taskCheck.addEventListener('change', () => {
    if (taskCheck.checked === true) {
    taskCheck.classList.add('checked');
    this.completed = true;
    } else {
    taskCheck.classList.remove('checked');
    this.completed = false;
    }
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