• Converts a character to its CharCode

    If string contains multiple characters only the first one is converted

    Example

    Returns CharCode of 'A'

    const cc = charCodeOf('A');
    console.log(cc); // 65

    Example

    Returns NaN for empty String

    const cc = charCodeOf('');
    console.log(cc); // NaN

    Returns

    the CharChode of the character, or NaN if there is no character

    Parameters

    • character: string

    Returns CharCode

Generated using TypeDoc