title: How to reset a variables value (delete - undefined - null)
body: <p>I read if you declare a variable you can not delete it.<br>
  If you leave it undeclared you can.<br>
  I also read if you do not declare a variable it can cause issues later.</p>
  
  <p>Certain lints I have used have pointed out declared and undeclared issues in some of the stuff I have written, to stop the reporting of these issues and based off of all the information I have read thus far, I have opted to declare all my variables.</p>
  
  <p>Now here is where this becomes confusing for me.</p>
  
  <p>I am trying to build a random name generator that utilizes a <code>Math.random</code> routine, when I try to recycle this routine it adds to the previous one, I have tried to set the var undefined / null (which in themselves can be variables that are defined) and it still just adds the new results to the old ones, this is making the feature of regenerating a new name if you do not like the old one useless.</p>
  
  <p>After writing this I realized my question is two part:</p>
  
  <ul>
  <li>How to do you delete a value from a var and restart?</li>
  <li>Is declaring your variables really that important?</li>
  </ul>
  
  <p>I have yet to find any solid information on the difference between declared and undeclared other than it changes the inherent properties of the variables (mainly if a variable can be deleted or not)</p>
  
  <pre><code>var nameLength = Math.floor(Math.random() * (13 - 3) + 3); /* min 3 max 13*/
  testValue = Math.floor(Math.random() * (13 - 3) + 3);
  var compareLetter = 0;
  var randomLetter = "";
  var randomName = "";
  var capitolLetter = "";
  var checkLetter = 0;
  var nameTitle = "XXX"; /* titles add _ between title and name*/
  var nameLetters = [
      ["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"],
      ["a", "e", "i", "o", "u"],
      ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"]
  ];
  if (nameTitle !== "") { /* my attempt to subtract title length +1 from name length if over 13*/
      nameLength = nameLength + (nameTitle.length + 1);
      if (nameLength &gt; 13) {
          nameLength = nameLength - (nameLength - 13);
      }
  }
  for (i = 0; i &lt; nameLength; i++) {
      randomLetter = nameLetters[compareLetter][Math.floor(Math.random() * nameLetters[compareLetter].length)];
      checkLetter = nameLetters[1].indexOf(randomLetter);
      if (checkLetter &gt; -1) { /* my version of keeping consanants and vowels from stacking up */
          compareLetter = 2;
      } else {
          compareLetter = 1;
      }
      if (randomName.length &lt; 1) { /* my version to keep first letter capitolized*/
          capitolLetter = randomLetter.toUpperCase();
          randomName = randomName + capitolLetter;
      } else {
          randomName = randomName + randomLetter;
      }
  }
  if (nameTitle !== "") {
      alert(nameTitle + "_" + randomName);
  } else {
      alert(randomName);
  }
  alert("this is nameLength" + nameLength);
  alert("this is testValue " + testValue);
  delete nameLength;
  delete testValue;
  alert("this is nameLength" + nameLength);
  alert("this is testValue " + testValue); /* notice this was not displayed*/
  http://jsfiddle.net/OldGuyGamer/PJsZ3/4/
  </code></pre>
  
  <p>here is what I am working with, keep in mind that fiddle seems to GC after each run, the environment I am setting this up in does not do that.</p>