Angularjs: Show last four characters in a string and replace remaining with 'X'
<p>I'm trying to replace the characters with <code>X</code>, should look something like this  <code>XXXXXT123</code></p>

<p>I tried this:</p>

<pre><code>var sno = 'TEST123';
alert(sno.slice(0,3).replaceWith('X'));
</code></pre>

<p>But in the console it is showing an error</p>

<blockquote>
  <p>Uncaught TypeError: sno.slice(...).replaceWith is not a
  function(anonymous function)</p>
</blockquote>