title: Excel-Like Headers in JavaScript
body: <p>I'm trying to write a function that emits a sequence of strings to match the headers on Excel. If you aren't familiar with Excel, that sequence looks like:</p>
  
  <pre><code>A,B,...,Z,AA,...,AZ,BA,...,ZZ,AAA,...,etc.
  </code></pre>
  
  <p>This is the code I've come up with:</p>
  
  <pre><code>function next(id) {
      if(id === "")
          return "A";
      var prefix = id.substring(0, id.length-1);
      var last = id[id.length-1]
      if(last === "Z")
          return (next(prefix) + "A");
      return prefix + String.fromCharCode(id.charCodeAt(id.length-1) + 1);
  }
  </code></pre>
  
  <p>Do you know of any better/cleaner way of doing this?</p>