Skip to content

Commit 626d456

Browse files
committed
added example
1 parent b87185b commit 626d456

File tree

1 file changed

+11
-1
lines changed
  • Methods Extended Studies/Array Methods Extended Study

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@
1414
//
1515
// EXAMPLES //////////////////////////////////////////////////////////////////////////////////////////////////
1616
//
17-
// EXAMPLE 1:
17+
// EXAMPLE 1: Create a function that determines if a string starts with a certain character.
1818
//
1919
// RESOURCES /////////////////////////////////////////////////////////////////////////////////////////////////
2020
//
2121
//
2222
//
2323
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
24+
25+
// EXAMPLE 1: Create a function that determines if a string starts with a certain character.
26+
27+
const myString = "This is a string";
28+
29+
function findFirstLetters(string, input) {
30+
const firstLetters = string.startsWith(input);
31+
console.log(firstLetters);
32+
}
33+

0 commit comments

Comments
 (0)