Skip to content

Commit 8562710

Browse files
committed
refactor dir completed
1 parent 98d4d64 commit 8562710

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎Sprint-1/refactor/includes.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Refactor the implementation of includes to use a for...of loop
22

33
function includes(list, target) {
4-
for (let index = 0; index < list.length; index++) {
5-
const element = list[index];
6-
if (element === target) {
4+
for (const item of list) {
5+
if (item === target) {
76
return true;
87
}
98
}

0 commit comments

Comments
 (0)