https://docs.vultr.com/javascript/global/parseInt
vascript parseint parseInt() is a JavaScript function used to convert a string into an integer.
parseInt(string, radix);
string → The value to convert to an integer.
radix (optional) → The base (2-36) of the numerical system. Default is 10 (decimal) if not specified.
Example 1: Basic Usage
javascript
Copy
Edit
console.log(parseInt("42"); // Output: 42
console.log(parseInt("3.14"); // Output: 3 (decimal part is removed)
console.log(parseInt("100", 2)); // Output: 4 (binary "100" → decimal 4)

image