Open medaminedev66 opened 3 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; ) } })
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 :