Skip to content

DRY, KISS, and YAGNI rules. #8

@Chandan-devs-tech

Description

@Chandan-devs-tech

localStorage.setItem('arrayOfTasks', JSON.stringify(arrayOfTasks));

localStorage.setItem('arrayOfTasks', JSON.stringify(arrayOfTasks));

localStorage.setItem('arrayOfTasks', JSON.stringify(arrayOfTasks));

localStorage.setItem('arrayOfTasks', JSON.stringify(array));

localStorage.setItem('arrayOfTasks', JSON.stringify(arrayOfTasks));

  • This code is not DRY cause repeated lines of could is visible. Try to use a function for your local storage set item and just call the function again and again instead of writing the whole statement.

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