How do I tell Javascript to use zero as a variable if the passed variable if empty? In PHP I can use the following.
<?php
function test($var=0){
echo $var;
}
?>
So it would set $var to 0 if the passed variable was empty. I can't seem to figure this out in Javascript.
Thanks