• Returns the rightmost length characters of the given string

    Parameters

    • Optionaltext: null | string

      the text to inspect

    • Optionallength: number

      the expected length

    Returns string | undefined | null

    the rightmost length characters of the given string

    right('foobar', 3);    // 'bar'
    right('foobar', 10); // 'foobar'