let message ="hello https://ggogle.com parul https://yahoo.com and http://web.com";
let url=["https://ggogle.com", "https://yahoo.com", "http://web.com"];
I want to put text "***"
in place of all url found in the message array from url array.
Tried this way -
let message = "hello https://ggogle.com parul https://yahoo.com and http://web.com";
let url = ["https://ggogle.com", "https://yahoo.com", "http://web.com"];
const replace = url.map(item => {
let indexes = message.indexOf(item);
let output = message.replaceAt(indexes, "***")
})
Error-message.replace is not a function,also if the logic is correct? Thanks!