All Questions
1 question
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){
...