Skip to content

Commit 69717b1

Browse files
committed
practice substring function
1 parent c778acb commit 69717b1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Sprint-2/Prep/functions.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ const number1 = "50"
2121
const number2 = "100"
2222
const result = Number(number1) + Number(number2)
2323
console.log(result)
24+
25+
let hobby = "I love football and traveling"
26+
let moreHobby = hobby.replaceAll("football", "swiming").replaceAll("traveling", "hiking")
27+
console.log(moreHobby)
28+
29+
const passion = hobby.substring(0, 15)
30+
console.log(passion)

0 commit comments

Comments
 (0)