medaminedev66 / to-do-list

A simple App that allows a user to make a to-do list.
https://medaminedev66.github.io/to-do-list/dist/
3 stars 0 forks source link

Check out the project if it follows JavaScript best practices #4

Open medaminedev66 opened 2 years ago

medaminedev66 commented 2 years ago

form line 67 to line 76 : https://github.com/medaminedev66/to-do-list/blob/a23a59886f003ab265a073405796096f1e0145d7/src/index.js#L67-L76 it can be changed with :

let max = list[0].index; 
     list.foreEach(item=>{
         if (item.index > max) { 
            max = item.index; 
          } else { 
            const temp = list[i]; 
             list[i] = list[i - 1]; 
             list[i - 1] = temp; )
          }
})