che ne dite vi sembra valido come approccio ?Codice PHP:
function pippo(o){
return (isNaN(+o))?10:o;
}
alert(pippo(2));
invece di (o == undefined || o=='')?10
![]()
che ne dite vi sembra valido come approccio ?Codice PHP:
function pippo(o){
return (isNaN(+o))?10:o;
}
alert(pippo(2));
invece di (o == undefined || o=='')?10
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Prova
e guarda il risultato...Codice PHP:
alert(pippo(""));
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it