I have this simple function in php and the parameter is a pointer. What is the equivalent of this in JavaScript.
<?php
function test( &$val )
{
echo $val;
$val ++;
}
$value = 5;
test( $value );
echo $value
?>
Can be done using an object as parameter?
Thank you.