string.endsWith() checks if a string ends with another string.
String.prototype.endsWith() checks if a string ends with another string.
This refactoring replaces index-based single-character comparison with
s[s.length - 1] === '/' becomes
What do I need to consider?
String.endsWith is an ES20215 feature. It is supported on all modern browsers, but for older browsers polyfilling might be required
- Code Assist ID (for the configuration file):
- You can configure custom keyboard shortcuts with this code action kind:
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.