String endsWith() method

Find out all the information about the JavaScript endsWith() method of the string

Check whether the string ends with the value of the string passed as a parameter.

'JavaScript'.endsWith('Script') //true
'JavaScript'.endsWith('script') //false

You can pass a second parameter with an integer value and (if it exists)endsWith()Think that the original string seems to have so many characters:

'JavaScript'.endsWith('Script', 5) //false
'JavaScript'.endsWith('aS', 5) //true

It is inECMAScript 2015.

Download mine for freeJavaScript beginner's manual


More js tutorials: