1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
const justA = { a: 1 };
// Object Spread
const AandB = { ...justA, b: 2 };
// Object Rest
const { a: _, ...justB } = AandB;
// RegExp unicode ("u") flag
Boolean(/abc/u.exec("abc"));
// Promise.prototype.finally()
Promise.resolve().finally(() => {
// at last!
});
// RegExp "s" flag
Boolean(/.{3}/s.exec("a\nb"));
// Regex Lookbehind Assertions
Boolean(/(?<=\$)\d+/.exec("$42"));
// Tagged template literal revision
String.raw`\unicode`; // Good
// RegExp named capture groups
/(?<year1>\d{4})-(?<year2>\d{4})/.exec("1992-2019");
|