Skip to content

JavaScript best practices #5

@sanieni6

Description

@sanieni6

JavaScript best practices

issues that I found in my project:

  • Kindly use just one line to set the values:

    ToDoList/src/index.js

    Lines 17 to 19 in 1251dd6

    task.description = textInput.value;
    task.completed = false;
    task.index = index;

  • Please try to add the styles in the CSS file and just import them using the"classList.add" statement in the javascript file:

    liElement[index].style.background = '#fff';
    element.style.background = '#fff';
    deleteButton[index].style.background = '#fff';

    liElement[index].style.background = '#fff59e';
    element.style.background = '#fff59e';
    element.style.textDecoration = 'none';
    deleteButton[index].style.background = '#fff59e';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions