Javascript best practices
Opened this issue · 0 comments
Braingenius2 commented
Review on Javascript best practices
- Object Destructuring:
- By destructuring the task object in the forEach loop like this :
this.tasks.forEach((task) => {
const { index, completed, description } = task; // Destructuring task object
// rest of code;
I can directly access the index, completed, and description properties without repeating "task." every time. link to code