Skip to main content
Module

x/lodash_es/mod.ts>parseInt

lodash for deno use
Latest
function parseInt
import { parseInt } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used unless value is a hexadecimal, in which case a radix of 16 is used.

Note: This method aligns with the ES5 implementation of parseInt.

Examples

_.parseInt('08'); // => 8

_.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]

Parameters

string

The string to convert.

radix
guard