Skip to content

Commit 9180a4d

Browse files
committed
Split() Method
1 parent 44cba04 commit 9180a4d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

basics/string-split.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let quote = "Kill Me Heal Me";
2+
let words = quote.split(" ");
3+
let characters = quote.split("");
4+
let l = quote.split("l");
5+
console.log("Total words in quote:", words.length);
6+
console.log("Total characters in quote:", characters.length);
7+
console.log("Total 'L' in quote:", l.length - 1);

0 commit comments

Comments
 (0)