title: JavaScript Array.shift not working
body: <p>I have been programming a system that is supposed to delete the first index of an array. Instead of changing an array from (i.e) "1,2,3,4,5" to "2,3,4,5" the console gives an error: "Uncaught TypeError: num.splice is not a function". I have heard that num.splice <em>is not</em> a function, it is an operation (or something) to delete the first indexed value of the array. I am confused that when I use an example code from <a href="https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_shift" rel="nofollow noreferrer">w3Schools</a>, there is no outputted error in the console. I don't understand why this happens.</p>
  
  <p><strong>(I have given the entire code just in case it has to do with syntax issues)</strong></p>
  
  <pre><code>function dCrypt() {
      var num = document.getElementById("demoin").value; // ex: a127
      var key = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
      var mod = 0;
      var out = 0;
      var prep = 0;
      var pre = 0;
      num.split("");
      mod = num[0];
      pre = key.indexOf(mod);
      num.splice(0,1);
      for (i=0;i &lt;= pre;i++) {
          prep += 26;
      }
      out = Math.floor(num + pre);
      document.getElementById("demoout").innerHTML = out;
  }
  </code></pre>
  
  <p>Thanks in advance!</p>