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