htmx
htmx copied to clipboard
Inconsistency with `indexOf`
htmx does operations with strings throughout it. However, it's not very consistent.
Since htmx has to work in IE11, it can't use .startsWith, so it has a startsWith function. However, there are a couple odd things:
- the logic isn't as simple as
str.indexOf(prefix) === 0, instead it does some more logic with substring - in some places,
str.indexOf(prefix) === 0is used instead of callingstartsWith
From the main page. 🙂