我有这样的代码:
const rtf = new Intl.RelativeTimeFormat('en', { style: 'short', numeric: "auto" });
在 Safari/605.1.15 中触发错误:
TypeError: undefined is not a constructor (evaluating 'new Intl.RelativeTimeFormat('en', { style: 'short', numeric: "auto" })')
现代 JS 中的一个如何解决 Intl API 可能不存在的事实?
子衿沉夜
相关分类