phast184/link-checker-tool

Replace for loop with For... of

Closed this issue · 0 comments

c3ho commented

for (i = 0; i < validURLs.length; i++) {
checkURL(validURLs[i]);

There's a new way to iterate through the list that will make sure you're never out of range or have to worry about the element number

You can change it to something like below

for (const url of validUrls) {
  checkUrl(url)
}

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of