title: Split a declartion of an array string into an array of strings
body: <p>What would be the best way to split an a string that a declaration of an array into an array of strings using javascript/jquery. An example of a string I am working with:</p>
  
  <pre><code> franchise[location][1][location_name]
  </code></pre>
  
  <p>I would like it to be converted into an array like:</p>
  
  <pre><code>['franchise', 'location', '1', 'location_name']
  </code></pre>
  
  <p>BONUS: If I could also get that numeric value to be an integer and not just a string in one fell swoop, that would be terrific.</p>