Browser vendors and the TC39 standards committee regularly deprecate APIs that are superseded by better, more secure, or more consistent alternatives. Each entry below covers the deprecated function, why it was removed, and the modern replacement you can copy immediately.

Deprecated Features

DeprecatedDescriptionReplacement
escape() / unescape()Deprecated encoding functions — unsafe and inconsistent behaviorUse encodeURIComponent() / decodeURIComponent() for URI components
document.execCommand()Deprecated for modifying document content — no longer maintainedUse the modern Clipboard API (navigator.clipboard.writeText())
String.substr()Deprecated string extraction — unclear semantics with negative indicesUse slice() or substring() for string extraction

Quick Check

// Run ESLint with the deprecated API rules enabled
npx eslint --rule '{"no-restricted-globals": "error"}' src/