Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
5 answers
747 views

Is copy and paste the head of for-loop (e.g.:for(let i=0;i<something.length;i++)) violating DRY principle?

For example, in my project, I often found some head of for-loop appears many times, eg: for(let i=0;i<SharedData.students.length;i++){ SharedData.students[i].something=..... } if(isReset){ ...
ocomfd's user avatar
  • 5,722