Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Use the replace() String Method in javascript

const string = "Hello world"

const modified = string.replace("world", "developers")

console.log(string)
// Hello world

console.log(modified)
// Hello developers
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #Use #String #Method #javascript
ADD COMMENT
Topic
Name
6+7 =