File: es2018.js

package info (click to toggle)
node-gulp-sourcemaps 3.0.0%2B~cs4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 812 kB
  • sloc: javascript: 3,584; sh: 15; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (2)
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");