You are viewing a single comment's thread. Return to all comments →
Curious about the for loop here:
for (let i = s.length; i-- > 0;)
The use of postfix incrementing on the i variable caught my eye. Is this structure considered good practice? Usually we see:
for (let i = s.length; i > 0; i--)
Which does the same thing but is a bit easier to read as it follows the standard 3 statement structure.
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
Curious about the for loop here:
The use of postfix incrementing on the i variable caught my eye. Is this structure considered good practice? Usually we see:
Which does the same thing but is a bit easier to read as it follows the standard 3 statement structure.