I'm trying to replace the characters with X, should look something like this XXXXXT123
I tried this:
var sno = 'TEST123';
alert(sno.slice(0,3).replaceWith('X'));
But in the console it is showing an error
Uncaught TypeError: sno.slice(...).replaceWith is not a function(anonymous function)
String.prototype.replaceWithdoesn't exist.