endsWith (Function)

Signature: endsWith(s: string, suffix: string) -> bool

Description: True if s ends with suffix.

Parameters

  • s (string): The string to test
  • suffix (string): The suffix to look for

Returns: bool

Example

endsWith("image.png", ".png")  // true
endsWith ("image.png", ".png")  // true