method to convert form names to valid JavaScript names?
<p>i am processing an object in JavaScript that has been returned from an API that may contain variable names that are not valid JavaScript variable names.  (these names are valid in the naming convention of the system of the API i am using)</p>

<p>in one case, the name starts with a number, e.g. '5story'</p>

<p>what is the best way to convert this name to a valid JavaScript variable name?</p>

<p>(i am familiar with the form of legal JavaScript names.  a useful answer to this question would be a (hopefully simple) algorithm e.g. prefix a $ to the name and then strip it when returning the form to the API)</p>

<p>(i note that it would be preferable if the JavaScript API did not create invalid names)</p>
