title: Getting empty array on applying splice. How to fix it?
body: <p>Here I want to add word at the last 4 letter before the x length. So i converted the string to array. Applied split. But when i tried to splice. Getting empty string on adding the second argument to the splice. Looking for help.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let x = "abcdefgh";
  console.log(x);
  console.log(x.length);
  let y = x.split('');
  console.log(y);
  let len = (y.length - 4);
  console.log(len);
  console.log(y.splice(len));
  console.log(y.splice(len, 0, "test"));</code></pre>
  </div>
  </div>
  </p>