javascript function default value for variable
function foo(a, b, c) {
var b = (b == null) ? "default" : b;
var c = (c == null) ? 100 : c;
...
}
doubling as CODEPROSTITUTE.COM blog
function foo(a, b, c) {
var b = (b == null) ? "default" : b;
var c = (c == null) ? 100 : c;
...
}
:10>>
:set sw=2
/**
* Increment or decrement a given position by a change amount within rules
*
* @author Richard AT d2p.us
* @param int $position
* @param int $change_by
* @param int $max
* @param int $min
* @param string $incOrDec
*/
function incrementDecrement(&$position, $change_by, $max, $min = 1, $incOrDec = "inc"){
if ($incOrDec == "inc"){
if (($position + $change_by ) <= $max){
$position = $position + $change_by;
}else {
$position = $max;
}
}else {
if (($position - $change_by ) >= $min){
$position = $position - $change_by;
}else{
$position = $min;
}
}
}
cp libs/libphp4.so /usr/libexec/httpd/libphp4.so
./configure --help
for more.