alert (my_parseInt("")); function my_parseInt(s) { var x = parseInt(s); if (isNaN(x)) return 0; return x; }