Skip to content

Commit

Permalink
Fixed expected output on String.prototype.indexOf() page
Browse files Browse the repository at this point in the history
  • Loading branch information
tvxxd committed Nov 5, 2023
1 parent 617205f commit 07d52a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions live-examples/js-examples/string/string-indexof.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const searchTerm = 'dog';
const indexOfFirst = paragraph.indexOf(searchTerm);

console.log(`The index of the first "${searchTerm}" is ${indexOfFirst}`);
// Expected output: "The index of the first "dog" is 7"
// Expected output: "The index of the first "dog" is 15"

console.log(
`The index of the second "${searchTerm}" is ${paragraph.indexOf(
searchTerm,
indexOfFirst + 1,
)}`,
);
// Expected output: "The index of the second "dog" is 41"
// Expected output: "The index of the second "dog" is 38"

0 comments on commit 07d52a3

Please sign in to comment.