goldies
    Preparing search index...

    Function endsWith

    • Check if a string ends with a specified substring, case-insensitive.

      Parameters

      • str: string

        The string to check.

      • ends: string

        The substring to check if it's at the end of the string.

      Returns boolean

      True if the string ends with the specified substring, false otherwise.

      // returns true
      const result = endsWith('JavaScript', 'script');

      Use the built-in endsWith, lowercasing both strings for the same case-insensitive check: str.toLowerCase().endsWith(ends.toLowerCase()). Will be removed in goldies 6.0.