Every line of 'mdn parseint' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
28 function parseDec(dec) { 29 return parseInt(dec, 10); 30 }
30 function toInt(n: string): number { 31 const result = parseInt(n, 10); 32 return isNaN(result) ? 0 : result; 33 }
8 function maybeParseInt(n) { 9 if (typeof n === 'string' && n.match(/^[0-9]+$/)) { 10 return parseInt(n); 11 } 12 return n; 13 }
58 function integer(n) { return n%(0xffffffff+1); }
56 function getInt(p, n, d) { 57 var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; 58 var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; 59 60 return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); 61 }