Stop Using substr(): The Deprecated JavaScript API and the Right Replacements (slice vs substring)
substr() is deprecated and risky to rely on. This guide explains why, contrasts it with slice() and substring(), and provides a clear migration checklist and best practices.