endsWith() returns true if a string ends with a specified string, otherwise false.
Check if the 11 first characters of "Hello world" ends with "world":
endsWith() is not supported in IE 11 (or earlier versions).