Skip to content

Commit 6f25d19

Browse files
committed
invistigate/ find.js DONE
1 parent c84ff52 commit 6f25d19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sprint-3/revise/investigate/find.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ console.log(find("code your future", "z"));
2020
// Pay particular attention to the following:
2121

2222
// a) How the index variable updates during the call to find
23+
/* The index variable increase by 1 in each iteration of the loop until the target character is found or the end of the string */
2324
// b) What is the if statement used to check
25+
/* Checks whether the character at the current position indexis equal to the target character char */
2426
// c) Why is index++ being used?
27+
/* Increment the index variable */
2528
// d) What is the condition index < str.length used for?
29+
/* To ensure that the loop continues iterating through the string */

0 commit comments

Comments
 (0)