ES2021 & ES12
ES2021 new features
replaceAll
String.prototype.replaceAll
const str = `abc,abc`;
str.replaceAll(`abc`, `xyz`)
// "xyz,xyz"
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll
'🍏🍏🍋🍋🍊🍊🍓🍓'.replace(/🍏/g, '🥭');
// "🥭🥭🍋🍋🍊🍊🍓🍓"
'🍏🍏🍋🍋🍊🍊🍓🍓'.replaceAll(`🍏`, '🥭');
// "🥭🥭🍋🍋🍊🍊🍓🍓"
https://v8.dev/features/string-replaceall
https://www.chromestatus.com/feature/6040389083463680
Promise.any
Logical Operators and Assignment Expressions
Numeric Separators
WeakRefs
Intl.ListFormat
dateStyle and timeStyle options for Intl.DateTimeFormat
refs
https://dev.to/albertomontalesi/everything-new-coming-in-es2021-2l5l
©xgqfrms 2012-2020
www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!