Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 550 Bytes

endsWith.md

File metadata and controls

33 lines (21 loc) · 550 Bytes

strings.endsWith

endsWith(string, [substr=''])

Tests a string to see if it ends with a substring

Arguments

  1. string (string): input string
  2. [substr=''] (string): substring to test

Returns

(boolean): does the input end with the substring?

Example

const result = strings.endsWith('This sentence ends with', 'with');
console.log(result);
> true