Skip to content

Commit a67241a

Browse files
committed
added edge cases
1 parent bd8fccf commit a67241a

File tree

1 file changed

+4
-3
lines changed
  • Methods Extended Studies/Array Methods Extended Study

1 file changed

+4
-3
lines changed

Methods Extended Studies/Array Methods Extended Study/startsWith.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626

2727
const myString = "This is a string";
2828

29-
function findFirstLetters(string, input) {
30-
const firstLetters = string.startsWith(input);
29+
function findFirstLetters(string, input, posStart) {
30+
const firstLetters = string.startsWith(input, posStart);
3131
console.log(firstLetters);
3232
}
3333

3434

3535
findFirstLetters(myString, 'This'); // true
36-
findFirstLetters(myString, 'is'); // false
36+
findFirstLetters(myString, 'is'); // false
37+
findFirstLetters(myString, 'is', 5); // true

0 commit comments

Comments
 (0)