Skip to content

Commit 31a874c

Browse files
committed
refractored the code . the test still passes
1 parent 7165d34 commit 31a874c

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 (let num of list) {
5+
if (num === target) {
76
return true;
87
}
98
}

0 commit comments

Comments
 (0)