JavaScript String endsWith Method

Introduction

Introduced in ES6

Syntax

console.log('hello'.endsWith('ello')) // true
console.log('hello'.endsWith('ello', 5)) // true

See also

  • [JavaScript String startsWith Method](JavaScript String startsWith Method)
  • [JavaScript String Prototype Methods](JavaScript String Prototype Methods)