coding style: is to copy and paste the for-loop header (for example: for (let i = 0; i

For example, in my project, I often found that some for-loop headers appear many times, for example:

for (be i = 0; i <SharedData.students.length; i ++) {
SharedData.students[i]. something = .....
}

if (isReset) {
for (be i = 0; i <SharedData.students.length; i ++) {
SharedData.students[i].Restart();
}
}
.
.
.

that the task inside and outside of the for loop is totally different, but commonly

for (be i = 0; i <SharedData.students.length; i ++)

. So my question is, it's copy and paste.

for (be i = 0; i <SharedData.students.length; i ++)

violating the DRY principle?