Skip to content

Commit f978ff5

Browse files
committed
'includes' function refactured
1 parent 0c5f55e commit f978ff5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sprint-1/refactor/includes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +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];
4+
5+
for (const element of list) {
66
if (element === target) {
77
return true;
88
}

0 commit comments

Comments
 (0)