JavaScriptでstartsWith/endsWithが欲しければ、Underscore.string.jsを使うといいと思うJavaScriptUnderscore.js JavaScriptにはstartsWith/endsWithがなくて、色々なサイトでこうやって実装すればいいよみたいな解説記事がありますが、Underscore.jsと一緒にUnderscore.string.jsを読み込んで、.startsWith(string, starts)と.endsWith(string, ends)を使えばいいのではと思う。 Underscore.jsに比べてUnderscore.string.jsはそこまで知名度がない気がするけど、startsWith/endsWith以外にも便利なメソッドが揃っているので、読み込んでおいて損はないと思う。 各メソッドは上記URLのREADMEに
