replace format javascript code example
Example 1: printf statement in javascript
let soMany = 10;
console.log(`This is ${soMany} times easier!`);
// "This is 10 times easier!
Example 2: javascript regex replace
const search = 'duck'
const replaceWith = 'goose';
const result = 'duck duck go'.replaceAll(search, replaceWith);
result; // => 'goose goose go'