function return two values
<p>I want to ask how effective is this function and if there are any situations when I can use it.  Thanks for any answers.</p>

<pre><code>function sum_and_dif(a, b) {
    var c = a + b;
    var d = a - b;
    return c +" " + d;
}

var result = sum_and_dif (200, 10);

document.write(result +"&lt;/br&gt;");

var where_is_a = result.indexOf(" ");// Here i detected where is the empty space
var c_number = parseInt(result.substring(0, where_is_a));
var d_number = parseInt(result.substring(where_is_a +1,result.length));

document.write(c_number +"&lt;/br&gt;");
document.write(d_number +"&lt;/br&gt;");
</code></pre>
