how can I return a result from a function into a variable?
<p>I have a variable :</p>

<pre><code>var name = [Nick,John,Peter]
</code></pre>

<p>and a function:</p>

<pre><code> func name(){

 var personname = []
         .......

       return personname
 } 
</code></pre>

<p>the result of the function are the names of the people Nick,John,Peter. How can I return the result into the variable.I mean I do not want to write the names manually I want to populate them from the function, because the function display all of the names. I am beginner and I will be glad if you show me the right syntaxis. </p>

<pre><code>  var name = [????] = [personname()] or how????
</code></pre>