Replace words in a string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Replace words in a string

I’ve been given the problem of creating a function in JavaScript that replaces the contents of a string with a random word of my choice. I’m completely stuck on this! Please help!

19th Mar 2018, 8:12 PM
Avery Chandler
Avery Chandler - avatar
1 Answer
+ 3
There's replace() function for it
19th Mar 2018, 8:15 PM
Toni Isotalo
Toni Isotalo - avatar