replece() method 100%

pull/420/head
Fitsumhelina 10 months ago
parent d9cc6e0036
commit 350fcf6335

@ -3,13 +3,8 @@
// First remove all the punctuations and change the string to array and count the number of words in the array // First remove all the punctuations and change the string to array and count the number of words in the array
let text = let text ='I love teaching and empowering people. I teach HTML, CSS, JS, React, Python.'
'I love teaching and empowering people. I teach HTML, CSS, JS, React, Python.' const word = text.replace(/[,.]/ ,'')
console.log(words)
console.log(words.length)
["I", "love", "teaching", "and", "empowering", "people", "I", "teach", "HTML", "CSS", "JS", "React", "Python"]
13
// In the following shopping cart add, remove, edit items // In the following shopping cart add, remove, edit items
const shoppingCart = ['Milk', 'Coffee', 'Tea', 'Honey'] const shoppingCart = ['Milk', 'Coffee', 'Tea', 'Honey']

Loading…
Cancel
Save