Comment

Comment by roblabla

Good point. Should have been

"test".substr("test".length - "st".length) === "st"

Or is it substring? Might there be an off by one in there? Anyway, this kind of reflexion only proves my point. There's no reason to question what endsWith does, because it's obvious. It's the correct abstraction in many cases.

parent roblabla 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton