Skip to content

Commit d7b2aff

Browse files
committed
update: refactor code function to use a for...of loop
1 parent 0ba1d5f commit d7b2aff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Sprint-1/refactor/includes.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// Refactor the implementation of includes to use a for...of loop
2-
31
function includes(list, target) {
4-
for (let index = 0; index < list.length; index++) {
5-
const element = list[index];
2+
for (const element of list) {
63
if (element === target) {
74
return true;
85
}

0 commit comments

Comments
 (0)