I have a javascript function:
function myFunction(value1,value2,value3)
{
//Do stuff and
value2=somevalue2 //to return
value3=somevalue3 //t
The answers cover things very well. I just wanted to point out that the mechanism of out parameters, as described in the question isn't very javascriptish. While other languages support it, javascript prefers you to simply return values from functions.
With ES6/ES2015 they added destructuring that makes a solution to this problem more elegant when returning an array. Destructuring will pull parts out of an array/object:
function myFunction(value1)
{
//Do stuff and
return [somevalue2, sumevalue3]
}
var [value2, value3] = myFunction("1");
if(value2 && value3)
{
//Do some stuff
}