• Returns whether the given string ends with the suffix

    Parameters

    • Optionaltext: null | string

      the source string to check

    • Optionalsuffix: null | string

      the target string to compare

    Returns boolean

    whether the given string ends with the suffix

    endsWith('foobar', 'bar');    // true
    endsWith('hello', 'bar'); // false