Function parseOctal

  • Parses a string to a octal number. Returns undefined instead of NaN if it fails.

    Example

    parseOctal("101"); // 0o101 -> 65
    parseOctal("101.5"); // 0o101 -> 65
    parseOctal("invalid"); // undefined

    Returns

    Parsed number or undefined if it fails.

    Parameters

    • string: string

    Returns Maybe<number>