--- date: 20201112 id: 00b0d7a6-4222-47e3-a0c9-58f071fa404e title: JavaScript String endsWith Method --- # Introduction Introduced in [ES6](20201030093404-es6) # Syntax ``` javascript console.log('hello'.endsWith('ello')) // true console.log('hello'.endsWith('ello', 5)) // true ``` # See also - [startsWith](20201112095525-javascript_string_startswith_method) - [JavaScript String Prototype Methods](20201112095341-javascript_string_prototype_methods)