I want to create a JavaScript function which replace the word followed by @
Example:
var sample = "Hello @Jon how are you";
var result = myfunction(sample);
// result should be like "Hello xxxxxx how are you"
Here @ symbol also need to be replaced.
xxxxshould be derresult = sample.replace(/@\w+/, 'xxxxx');