Introduction Introduced in ES6 Syntax console.log('hello'.endsWith('ello')) // true console.log('hello'.endsWith('ello', 5)) // true See also startsWith JavaScript String Prototype Methods