Comment

Comment by pablovidal85

Negative substr() already does the trick, I don't see the need for endsWith() at all.

  'test'.substr(-'st'.length) === 'st'
parent pablovidal85 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton