Javascript condition assign value to data variable
<p>I am reading some data from the database which are numbers.</p>

<p>What I need to do is to assign a name to each number ... </p>

<p>something like:</p>

<pre><code>get the variable: ... thevar = '1';

If thevar = 1 then myname = 'name1';
else
If thevar = 2 then myname = 'name2';
</code></pre>

<p>How can I do this with javascript?</p>

<p>Sorry, I don't think I've explained it properly...what I need if the syntax on how I would do this the above with javascript.</p>

<p>Hope it now makes more sense.</p>
