Repository navigation
Expand file tree
/
Copy pathfeatures.json
More file actions
2267 lines (2267 loc) · 86.8 KB
/
Copy pathfeatures.json
File metadata and controls
2267 lines (2267 loc) · 86.8 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"id": "strict-mode",
"name": "Strict Mode",
"description": "Introduces a restricted variant of JavaScript that eliminates silent errors by throwing exceptions, disables features that are confusing or poorly thought out, and simplifies variable resolution (e.g., forbidding implicit global creation).",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "strict-mode",
"sampleFile": "samples/es2011/strict-mode.js",
"functionName": "demoStrictMode",
"compatKey": "javascript.statements.strict_mode",
"category": "syntax",
"tsTarget": "es5",
"tsLib": null,
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "function-prototype-bind",
"name": "Function.prototype.bind",
"description": "Creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "functions",
"sampleFile": "samples/es2011/function-bind.js",
"functionName": "demoFunctionBind",
"compatKey": "javascript.builtins.Function.bind",
"category": "method",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "native-json-parsing-and-serialization",
"name": "Native JSON Parsing and Serialization",
"description": "Standardizes a built-in `JSON` object for parsing JSON text strings into JavaScript objects and serializing values into JSON formatted strings without relying on `eval()`.",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "json",
"sampleFile": "samples/es2011/json.js",
"functionName": "demoJSON",
"compatKey": "javascript.builtins.JSON",
"category": "api",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "object-literal-getters-and-setters",
"name": "Object Literal Getters and Setters",
"description": "Introduces syntax for binding an object property to a function that will be invoked when that property is looked up (`get`) or assigned to (`set`).",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "functions",
"sampleFile": "samples/es2011/getters-and-setters.js",
"functionName": "demoGettersAndSetters",
"compatKey": "javascript.functions.get",
"category": "syntax",
"tsTarget": "es5",
"tsLib": null,
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "string-property-access",
"name": "String Property Access",
"description": "Standardizes character access via square bracket notation (str[index]) as an alternative to charAt(index).",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "strings",
"sampleFile": "samples/es2011/string-indexing.js",
"functionName": "demoStringIndexing",
"compatKey": "javascript.builtins.String",
"category": "syntax",
"tsTarget": "es5",
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-trim",
"name": "String.prototype.trim",
"description": "Strips leading and trailing whitespace from strings.",
"esVersion": "ES5.1 (2011)",
"webFeatureId": "strings",
"sampleFile": "samples/es2011/string-trim.js",
"functionName": "demoStringTrim",
"compatKey": "javascript.builtins.String.trim",
"category": "method",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "const-declarations",
"name": "const Declarations",
"description": "Block-scoped read-only constant declaration.",
"esVersion": "ES2015",
"webFeatureId": "let-const",
"sampleFile": "samples/es2015/const-declarations.js",
"functionName": "demoConst",
"compatKey": "javascript.statements.const",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "iterators-and-for-of-statement",
"name": "Iterators and for...of Statement",
"description": "Protocol for iterable objects (implementing `Symbol.iterator`) and the `for...of` loop to traverse iterable elements.",
"esVersion": "ES2015",
"webFeatureId": "iterators",
"sampleFile": "samples/es2015/iterators-and-for-of.js",
"functionName": "demoForOfAndIterators",
"compatKey": "javascript.statements.for_of",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": "es2015.iterable",
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__values"
]
},
{
"id": "promise-objects",
"name": "Promise Objects",
"description": "A built-in object representing the eventual completion (or failure) of an asynchronous operation and its resulting value.",
"esVersion": "ES2015",
"webFeatureId": "promise",
"sampleFile": "samples/es2015/promises.js",
"functionName": "demoPromise",
"compatKey": "javascript.builtins.Promise",
"category": "api",
"tsTarget": null,
"tsLib": "es2015.promise",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "binary-and-octal-numeric-literals",
"name": "Binary and Octal Numeric Literals",
"description": "Direct syntax for binary literals (`0b` or `0B` prefix) and octal literals (`0o` or `0O` prefix).",
"esVersion": "ES2015",
"webFeatureId": "number",
"sampleFile": "samples/es2015/numeric-literals.js",
"functionName": "demoNumericLiterals",
"compatKey": "javascript.grammar.binary_numeric_literals",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "symbol-primitive-type",
"name": "Symbol Primitive Type",
"description": "A unique and immutable primitive value that can be used as the key of an object property to avoid naming collisions. Also introduces well-known symbols like `Symbol.iterator` and `Symbol.toStringTag`.",
"esVersion": "ES2015",
"webFeatureId": "symbol",
"sampleFile": "samples/es2015/symbols.js",
"functionName": "demoSymbols",
"compatKey": "javascript.builtins.Symbol",
"category": "api",
"tsTarget": null,
"tsLib": "es2015.symbol",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "template-literals-and-tagged-templates",
"name": "Template Literals and Tagged Templates",
"description": "Multi-line string literals allowing embedded expressions via `${expression}` syntax, and tagged template functions that allow custom parsing and formatting of template literals.",
"esVersion": "ES2015",
"webFeatureId": "template-literals",
"sampleFile": "samples/es2015/template-literals.js",
"functionName": "demoTemplateLiterals",
"compatKey": "javascript.grammar.template_literals",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": "es2015.core",
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__makeTemplateObject"
]
},
{
"id": "enhanced-object-literals",
"name": "Enhanced Object Literals",
"description": "Syntactic enhancements for object initializers including property value shorthand, method definition shorthand, and computed property names.",
"esVersion": "ES2015",
"webFeatureId": "object-object",
"sampleFile": "samples/es2015/enhanced-object-literals.js",
"functionName": "demoEnhancedObjectLiterals",
"compatKey": "javascript.operators.object_initializer.shorthand_property_names",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "destructuring-assignment",
"name": "Destructuring Assignment",
"description": "Syntax allowing extraction of values from arrays or properties from objects into distinct variables, supporting default fallback values and nested destructuring.",
"esVersion": "ES2015",
"webFeatureId": "destructuring",
"sampleFile": "samples/es2015/destructuring.js",
"functionName": "demoDestructuring",
"compatKey": "javascript.operators.destructuring",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__read"
]
},
{
"id": "array-prototype-includes",
"name": "Array.prototype.includes",
"description": "Determines whether an array includes a certain value among its entries, returning true or false. Unlike `indexOf() !== -1`, `includes()` correctly compares `NaN` values using SameValueZero equality.",
"esVersion": "ES2016",
"webFeatureId": "array-includes",
"sampleFile": "samples/es2016/array-includes.js",
"functionName": "demoArrayIncludes",
"compatKey": "javascript.builtins.Array.includes",
"category": "method",
"tsTarget": null,
"tsLib": "es2016.array.include",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "arrow-function-definitions",
"name": "Arrow Function Definitions",
"description": "Provides a concise syntax for anonymous functions using the `=>` token. Arrow functions lexically bind `this`, `arguments`, `super`, and `new.target` from their enclosing scope rather than defining their own.",
"esVersion": "ES2015",
"webFeatureId": "functions",
"sampleFile": "samples/es2015/arrow-functions.js",
"functionName": "add",
"compatKey": "javascript.functions.arrow_functions",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "generator-functions-and-yield-statement",
"name": "Generator Functions and yield Statement",
"description": "Functions defined with `function*` that can be paused and resumed using the `yield` keyword, returning a Generator object that conforms to both the iterable and iterator protocols.",
"esVersion": "ES2015",
"webFeatureId": "generators",
"sampleFile": "samples/es2015/generators.js",
"functionName": "demoGenerator",
"compatKey": "javascript.statements.generator_function",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": "es2015.generator",
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__generator"
]
},
{
"id": "ecmascript-2015-6th-edition-code-samples",
"name": "let Declarations",
"description": "Block-scoped variable declaration. Resides in the Temporal Dead Zone until evaluation.",
"esVersion": "ES2015",
"webFeatureId": "let-const",
"sampleFile": "samples/es2015/let-declarations.js",
"functionName": "demoLet",
"compatKey": "javascript.statements.let",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "iterator-helpers",
"name": "Iterator Helpers",
"description": "Extends iterator objects with functional programming methods similar to Array prototype methods, enabling lazy, memory-efficient processing of potentially infinite sequences without intermediate array allocations.",
"esVersion": "ES2025",
"webFeatureId": "iterators",
"sampleFile": "samples/es2025/iterator-helpers.js",
"functionName": "demoIteratorHelpers",
"compatKey": "javascript.builtins.Iterator",
"category": "method",
"tsTarget": null,
"tsLib": "es2025.iterator",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "class-definitions-and-inheritance",
"name": "Class Definitions and Inheritance",
"description": "Introduces class syntax as syntactic sugar over prototype-based inheritance, including constructors, instance methods, static methods, and `extends`/`super` for subclassing.",
"esVersion": "ES2015",
"webFeatureId": "class-syntax",
"sampleFile": "samples/es2015/classes.js",
"functionName": "Animal",
"compatKey": "javascript.statements.class",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__extends"
]
},
{
"id": "exponentiation-operator",
"name": "Exponentiation Operator",
"description": "An infix operator for exponentiation, providing a cleaner shorthand for `Math.pow(base, exponent)`.",
"esVersion": "ES2016",
"webFeatureId": "exponentiation",
"sampleFile": "samples/es2016/exponentiation-operator.js",
"functionName": "demoExponentiationOperator",
"compatKey": "javascript.operators.exponentiation",
"category": "syntax",
"tsTarget": "es2016",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "object-entries",
"name": "Object.entries",
"description": "Returns an array of a given object's own enumerable string-keyed property [key, value] pairs.",
"esVersion": "ES2017",
"webFeatureId": "object-object",
"sampleFile": "samples/es2017/object-entries.js",
"functionName": "demoObjectEntries",
"compatKey": "javascript.builtins.Object.entries",
"category": "api",
"tsTarget": null,
"tsLib": "es2017.object",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "object-values",
"name": "Object.values",
"description": "Returns an array of a given object's own enumerable string-keyed property values.",
"esVersion": "ES2017",
"webFeatureId": "object-object",
"sampleFile": "samples/es2017/object-values.js",
"functionName": "demoObjectValues",
"compatKey": "javascript.builtins.Object.values",
"category": "api",
"tsTarget": null,
"tsLib": "es2017.object",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "async-await",
"name": "Async Functions",
"description": "Provides syntactic sugar over Promises, allowing asynchronous operations to be written in a synchronous, procedural style. Functions marked with `async` implicitly return a Promise, and `await` pauses execution until the Promise settles.",
"esVersion": "ES2017",
"webFeatureId": "async-await",
"sampleFile": "samples/es2017/async-await.js",
"functionName": "demoAsyncAwait",
"compatKey": "javascript.operators.async_function",
"category": "syntax",
"tsTarget": "es2017",
"tsLib": "es2015.promise",
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__awaiter",
"__generator"
]
},
{
"id": "object-getownpropertydescriptors",
"name": "Object.getOwnPropertyDescriptors",
"description": "Returns all own property descriptors of a given object, enabling accurate cloning of objects including getters, setters, and non-enumerable properties without losing their attributes.",
"esVersion": "ES2017",
"webFeatureId": "object-object",
"sampleFile": "samples/es2017/get-own-property-descriptors.js",
"functionName": "demoGetOwnPropertyDescriptors",
"compatKey": "javascript.builtins.Object.getOwnPropertyDescriptors",
"category": "api",
"tsTarget": null,
"tsLib": "es2017.object",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-padend",
"name": "String.prototype.padEnd",
"description": "Pads the current string from the end with another string until the target length is reached.",
"esVersion": "ES2017",
"webFeatureId": "string-pad",
"sampleFile": "samples/es2017/string-pad-end.js",
"functionName": "demoStringPadEnd",
"compatKey": "javascript.builtins.String.padEnd",
"category": "method",
"tsTarget": null,
"tsLib": "es2017.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-padstart",
"name": "String.prototype.padStart",
"description": "Pads the current string from the start with another string until the target length is reached.",
"esVersion": "ES2017",
"webFeatureId": "string-pad",
"sampleFile": "samples/es2017/string-pad-start.js",
"functionName": "demoStringPadStart",
"compatKey": "javascript.builtins.String.padStart",
"category": "method",
"tsTarget": null,
"tsLib": "es2017.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "trailing-commas-in-function-parameter-lists-and-calls",
"name": "Trailing Commas in Function Parameter Lists and Calls",
"description": "Allows trailing commas in function definitions and function calls, making git diffs cleaner when adding new parameters.",
"esVersion": "ES2017",
"webFeatureId": "functions",
"sampleFile": "samples/es2017/trailing-commas.js",
"functionName": "demoTrailingCommas",
"compatKey": "javascript.grammar.trailing_commas.trailing_commas_in_functions",
"category": "syntax",
"tsTarget": "es5",
"tsLib": null,
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "es-modules",
"name": "ES Modules",
"description": "Native syntax for modular programming using `export` and `import` declarations. Note: Since this entire file is an ES module using `export`, this feature is natively exemplified by the module structure itself.",
"esVersion": "ES2015",
"webFeatureId": "js-modules",
"sampleFile": "samples/es2015/modules.js",
"functionName": "moduleFeatureDemo",
"compatKey": "javascript.statements.import",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "promise-prototype-finally",
"name": "Promise.prototype.finally",
"description": "Registers a callback to be invoked when a Promise settles (either fulfilled or rejected), enabling cleanup operations without having to duplicate callbacks in both `.then()` and `.catch()`.",
"esVersion": "ES2018",
"webFeatureId": "promise-finally",
"sampleFile": "samples/es2018/promise-finally.js",
"functionName": "demoPromiseFinally",
"compatKey": "javascript.builtins.Promise.finally",
"category": "method",
"tsTarget": null,
"tsLib": "es2018.promise",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "async-iteration",
"name": "Asynchronous Iteration and Async Generators",
"description": "Introduces `async function*` for generating asynchronous sequences of data, and the `for await...of` loop to iterate over async iterables (objects implementing `Symbol.asyncIterator`).",
"esVersion": "ES2018",
"webFeatureId": "async-iterators",
"sampleFile": "samples/es2018/async-iteration.js",
"functionName": "demoAsyncGenerator",
"compatKey": "javascript.statements.for_await_of",
"category": "syntax",
"tsTarget": "es2018",
"tsLib": "es2018.asynciterable",
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__asyncValues",
"__asyncGenerator",
"__await"
]
},
{
"id": "rest-and-spread-properties-for-objects",
"name": "Rest and Spread Properties for Objects",
"description": "Extends the rest/spread syntax (`...`) to object literals. Rest properties collect remaining own enumerable properties into a new object during destructuring. Spread properties copy own enumerable properties into an object literal.",
"esVersion": "ES2018",
"webFeatureId": "object-object",
"sampleFile": "samples/es2018/object-rest-spread.js",
"functionName": "demoObjectRestSpread",
"compatKey": "javascript.operators.object_initializer.spread_properties",
"category": "syntax",
"tsTarget": "es2018",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__assign",
"__rest"
]
},
{
"id": "template-literal-revision",
"name": "Template Literal Revision",
"description": "Lifts restrictions on syntactic escape sequences within tagged template literals. Invalid escape sequences (e.g., `\\unicode`) result in `undefined` for string representation in `strings`, while `strings.raw` retains the raw text.",
"esVersion": "ES2018",
"webFeatureId": "template-literals",
"sampleFile": "samples/es2018/template-literal-revision.js",
"functionName": "demoTemplateLiteralRevision",
"compatKey": "javascript.grammar.template_literals.template_literal_revision",
"category": "syntax",
"tsTarget": "es2018",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__makeTemplateObject"
]
},
{
"id": "ecmascript-2019-10th-edition-code-samples",
"name": "Array.prototype.flat",
"description": "Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.",
"esVersion": "ES2019",
"webFeatureId": "array-flat",
"sampleFile": "samples/es2019/array-flat.js",
"functionName": "demoArrayFlat",
"compatKey": "javascript.builtins.Array.flat",
"category": "method",
"tsTarget": null,
"tsLib": "es2019.array",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "array-prototype-flatmap",
"name": "Array.prototype.flatMap",
"description": "Maps each element using a mapping function, then flattens the result into a new array by depth 1.",
"esVersion": "ES2019",
"webFeatureId": "array-flat",
"sampleFile": "samples/es2019/array-flat-map.js",
"functionName": "demoArrayFlatMap",
"compatKey": "javascript.builtins.Array.flatMap",
"category": "method",
"tsTarget": null,
"tsLib": "es2019.array",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "object-fromentries",
"name": "Object.fromEntries",
"description": "Transforms a list of key-value pairs (such as a Map or an array of `[key, value]` arrays) into an object. Acts as the inverse of `Object.entries()`.",
"esVersion": "ES2019",
"webFeatureId": "object-object",
"sampleFile": "samples/es2019/object-from-entries.js",
"functionName": "demoObjectFromEntries",
"compatKey": "javascript.builtins.Object.fromEntries",
"category": "api",
"tsTarget": null,
"tsLib": "es2019.object",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "optional-catch-binding",
"name": "Optional Catch Binding",
"description": "Allows omitting the exception binding variable in `catch` blocks when the thrown error object is not needed.",
"esVersion": "ES2019",
"webFeatureId": "optional-catch-binding",
"sampleFile": "samples/es2019/optional-catch-binding.js",
"functionName": "demoOptionalCatchBinding",
"compatKey": "javascript.statements.try_catch.optional_catch_binding",
"category": "syntax",
"tsTarget": "es2019",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "stable-array-prototype-sort",
"name": "Stable Array.prototype.sort",
"description": "Mandates that `Array.prototype.sort()` be stable, ensuring that array elements comparing equal retain their original order.",
"esVersion": "ES2019",
"webFeatureId": "stable-array-sort",
"sampleFile": "samples/es2019/stable-sort.js",
"functionName": "demoStableSort",
"compatKey": "javascript.builtins.Array.sort.stable_sorting",
"category": "method",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-trimend",
"name": "String.prototype.trimEnd",
"description": "Removes whitespace from the end of a string.",
"esVersion": "ES2019",
"webFeatureId": "string-trim-startend",
"sampleFile": "samples/es2019/string-trim-end.js",
"functionName": "demoStringTrimEnd",
"compatKey": "javascript.builtins.String.trimEnd",
"category": "method",
"tsTarget": null,
"tsLib": "es2019.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-trimstart",
"name": "String.prototype.trimStart",
"description": "Removes whitespace from the beginning (start) of a string.",
"esVersion": "ES2019",
"webFeatureId": "string-trim-startend",
"sampleFile": "samples/es2019/string-trim-start.js",
"functionName": "demoStringTrimStart",
"compatKey": "javascript.builtins.String.trimStart",
"category": "method",
"tsTarget": null,
"tsLib": "es2019.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "symbol-prototype-description",
"name": "Symbol.prototype.description",
"description": "A read-only property returning the optional string description specified when creating a Symbol object, directly without requiring `.toString()` conversion.",
"esVersion": "ES2019",
"webFeatureId": "symbol",
"sampleFile": "samples/es2019/symbol-description.js",
"functionName": "demoSymbolDescription",
"compatKey": "javascript.builtins.Symbol.description",
"category": "method",
"tsTarget": null,
"tsLib": "es2019.symbol",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "well-formed-json-stringify",
"name": "Well-Formed JSON.stringify",
"description": "Prevents `JSON.stringify` from returning ill-formed UTF-16 strings when encountering lone surrogate code points (U+D800 to U+DFFF), representing them instead as JSON escape sequences (e.g., `\\ud800`).",
"esVersion": "ES2019",
"webFeatureId": "json",
"sampleFile": "samples/es2019/well-formed-json.js",
"functionName": "demoWellFormedJSON",
"compatKey": "javascript.builtins.JSON.stringify.well_formed_stringify",
"category": "api",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "dynamic-import-import",
"name": "Dynamic Import (import())",
"description": "Function-like syntax allowing asynchronous, on-demand module loading at runtime, returning a Promise that resolves to the module namespace object.",
"esVersion": "ES2020",
"webFeatureId": "js-modules",
"sampleFile": "samples/es2020/dynamic-import.js",
"functionName": "demoDynamicImport",
"compatKey": "javascript.operators.import",
"category": "syntax",
"tsTarget": "es5",
"tsLib": "es2015.promise",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "globalthis",
"name": "globalThis",
"description": "Provides a universal standard mechanism to access the global `this` value across different JavaScript environments (e.g., `window` in browser, `global` in Node.js, `self` in Web Workers).",
"esVersion": "ES2020",
"webFeatureId": "globalthis",
"sampleFile": "samples/es2020/global-this.js",
"functionName": "demoGlobalThis",
"compatKey": "javascript.builtins.globalThis",
"category": "api",
"tsTarget": null,
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "import-meta-meta-property",
"name": "import.meta Meta-Property",
"description": "An object exposing context-specific metadata to a JavaScript module, such as the URL of the current module (`import.meta.url`).",
"esVersion": "ES2020",
"webFeatureId": "js-modules",
"sampleFile": "samples/es2020/import-meta.js",
"functionName": "demoImportMeta",
"compatKey": "javascript.operators.import_meta",
"category": "syntax",
"tsTarget": "es5",
"tsLib": "es5",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "string-prototype-matchall",
"name": "String.prototype.matchAll",
"description": "Returns an iterator of all results matching a string against a regular expression (which must have the `g` flag), including capturing groups for each match.",
"esVersion": "ES2020",
"webFeatureId": "string-matchall",
"sampleFile": "samples/es2020/string-match-all.js",
"functionName": "demoMatchAll",
"compatKey": "javascript.builtins.String.matchAll",
"category": "method",
"tsTarget": null,
"tsLib": "es2020.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "hashbang",
"name": "Hashbang Grammar",
"description": "Standardizes syntax stripping for executable scripts starting with `#!` (hashbang/shebang) on the very first line of a source file, allowing JavaScript files to run directly in Unix-like CLI environments without syntax errors. Note: Notice the `#!/usr/bin/env node` at line 1 of this file demonstrating this syntax!",
"esVersion": "ES2023",
"webFeatureId": "hashbang-comments",
"sampleFile": "samples/es2023/hashbang.js",
"functionName": "hashbangDemo",
"compatKey": "javascript.grammar.hashbang_comments",
"category": "syntax",
"tsTarget": "es5",
"tsLib": null,
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "regexp-named-capture-groups",
"name": "RegExp Named Capture Groups",
"description": "Allows capturing groups in regular expressions to be assigned explicit names via `(?<name>...)`, which can then be accessed on the `groups` property of the match object.",
"esVersion": "ES2018",
"webFeatureId": "regexp",
"sampleFile": "samples/es2018/regexp-named-capture-groups.js",
"functionName": "demoNamedCaptureGroups",
"compatKey": "javascript.regular_expressions.named_capturing_group",
"category": "syntax",
"tsTarget": "es2018",
"tsLib": "es2018.regexp",
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "regexp-s-dotall-flag",
"name": "RegExp s (dotAll) Flag",
"description": "Introduces the `s` flag for regular expressions, which alters the dot (`.`) metacharacter to match any character, including line terminators (like `\\n` and `\\r`).",
"esVersion": "ES2018",
"webFeatureId": "regexp",
"sampleFile": "samples/es2018/regexp-dot-all-flag.js",
"functionName": "demoDotAllFlag",
"compatKey": "javascript.builtins.RegExp.dotAll",
"category": "syntax",
"tsTarget": "es2018",
"tsLib": "es2018.regexp",
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "regexp-unicode-property-escapes",
"name": "RegExp Unicode Property Escapes",
"description": "Enables matching characters based on Unicode character properties inside regular expressions using `\\p{...}` and `\\P{...}` when the `u` flag is enabled.",
"esVersion": "ES2018",
"webFeatureId": "regexp",
"sampleFile": "samples/es2018/regexp-unicode-property-escapes.js",
"functionName": "demoUnicodePropertyEscapes",
"compatKey": "javascript.regular_expressions.unicode_character_class_escape",
"category": "syntax",
"tsTarget": "es2015",
"tsLib": null,
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "nullish-coalescing-operator",
"name": "Nullish Coalescing Operator",
"description": "A logical operator returning its right-hand operand when its left-hand operand is `null` or `undefined`, and otherwise returning its left-hand operand. Avoids overriding valid falsy values like `0` or `\"\"`.",
"esVersion": "ES2020",
"webFeatureId": "nullish-coalescing",
"sampleFile": "samples/es2020/nullish-coalescing.js",
"functionName": "demoNullishCoalescing",
"compatKey": "javascript.operators.nullish_coalescing",
"category": "syntax",
"tsTarget": "es2020",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "optional-chaining-operator",
"name": "Optional Chaining Operator",
"description": "Allows reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid. If a reference is nullish, expression short-circuits to `undefined`.",
"esVersion": "ES2020",
"webFeatureId": "object-object",
"sampleFile": "samples/es2020/optional-chaining.js",
"functionName": "demoOptionalChaining",
"compatKey": "javascript.operators.optional_chaining",
"category": "syntax",
"tsTarget": "es2020",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "promise-allsettled",
"name": "Promise.allSettled",
"description": "Returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects describing the outcome (`status: \"fulfilled\" | \"rejected\"`) of each promise.",
"esVersion": "ES2020",
"webFeatureId": "promise-allsettled",
"sampleFile": "samples/es2020/promise-all-settled.js",
"functionName": "demoPromiseAllSettled",
"compatKey": "javascript.builtins.Promise.allSettled",
"category": "api",
"tsTarget": null,
"tsLib": "es2020.promise",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "numeric-separators",
"name": "Numeric Separators",
"description": "Allows underscores (`_`) as visual separators within numeric literals (decimal, binary, hex, octal, BigInt) to enhance readability of large numbers without affecting programmatic values.",
"esVersion": "ES2021",
"webFeatureId": "numeric-separators",
"sampleFile": "samples/es2021/numeric-separators.js",
"functionName": "demoNumericSeparators",
"compatKey": "javascript.grammar.numeric_separators",
"category": "syntax",
"tsTarget": "es2021",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "string-prototype-replaceall",
"name": "String.prototype.replaceAll",
"description": "Returns a new string with all matches of a pattern (either a string or a RegExp with `g` flag) replaced by a replacement. Eliminates the need for regular expressions when replacing literal string occurrences globally.",
"esVersion": "ES2021",
"webFeatureId": "string-replaceall",
"sampleFile": "samples/es2021/string-replace-all.js",
"functionName": "demoReplaceAll",
"compatKey": "javascript.builtins.String.replaceAll",
"category": "method",
"tsTarget": null,
"tsLib": "es2021.string",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "bigint",
"name": "BigInt Arbitrary-Precision Integers",
"description": "Introduces a new numeric primitive type `BigInt` for representing integers of arbitrary magnitude, bypassing Number.MAX_SAFE_INTEGER limitations. Created via `n` suffix or `BigInt()` function.",
"esVersion": "ES2020",
"webFeatureId": "bigint",
"sampleFile": "samples/es2020/bigint.js",
"functionName": "demoBigInt",
"compatKey": "javascript.builtins.BigInt",
"category": "api",
"tsTarget": "es2020",
"tsLib": "es2020.bigint",
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "logical-assignment",
"name": "Logical Assignment Operators",
"description": "Combines logical operations with assignment. The assignment only occurs if the logical condition evaluates to trigger evaluation of the right-hand side (short-circuiting assignment).",
"esVersion": "ES2021",
"webFeatureId": "logical-assignments",
"sampleFile": "samples/es2021/logical-assignment.js",
"functionName": "demoLogicalAssignment",
"compatKey": "javascript.operators.logical_or_assignment",
"category": "syntax",
"tsTarget": "es2021",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-syntax",
"tsHelpers": []
},
{
"id": "error-cause",
"name": "Error Cause",
"description": "Allows specifying an underlying error cause via the `{ cause: err }` options object passed to Error constructors, aiding error chaining and debugging across async architectural layers.",
"esVersion": "ES2022",
"webFeatureId": "error-cause",
"sampleFile": "samples/es2022/error-cause.js",
"functionName": "demoErrorCause",
"compatKey": "javascript.builtins.Error.cause",
"category": "api",
"tsTarget": null,
"tsLib": "es2022.error",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "private-field-check-syntax",
"name": "Private Field Check Syntax",
"description": "Allows checking whether a specific private field or method is present on an object using the `in` operator, without throwing a TypeError when checking arbitrary objects.",
"esVersion": "ES2022",
"webFeatureId": "class-syntax",
"sampleFile": "samples/es2022/private-field-check.js",
"functionName": "SecureBox",
"compatKey": "javascript.classes.private_class_fields_in",
"category": "syntax",
"tsTarget": "es2022",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__classPrivateFieldIn"
]
},
{
"id": "regexp-match-indices",
"name": "RegExp Match Indices",
"description": "Introduces the `/.../d` regex flag, which instructs regex execution methods (`exec`, `matchAll`) to include an `indices` array property on the match object detailing the start and end character positions of each matched group.",
"esVersion": "ES2022",
"webFeatureId": "regexp",
"sampleFile": "samples/es2022/regexp-match-indices.js",
"functionName": "demoMatchIndices",
"compatKey": "javascript.builtins.RegExp.hasIndices",
"category": "syntax",
"tsTarget": "es2022",
"tsLib": "es2022.regexp",
"tsBelowTargetBehavior": "compiler-error",
"tsHelpers": []
},
{
"id": "at-method-on-indexable-objects",
"name": ".at() Method on Indexable Objects",
"description": "Takes an integer value and returns the item at that index, allowing positive integers for indexing from the start and negative integers for relative indexing from the end (e.g., `-1` for the last element).",
"esVersion": "ES2022",
"webFeatureId": "array-at",
"sampleFile": "samples/es2022/at-method.js",
"functionName": "demoAtMethod",
"compatKey": "javascript.builtins.Array.at",
"category": "method",
"tsTarget": null,
"tsLib": "es2022.array",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "object-hasown",
"name": "Object.hasOwn",
"description": "A static method that returns true if the specified object has the indicated property as its own property. Serves as a safer, more concise alternative to `Object.prototype.hasOwnProperty.call(obj, prop)`.",
"esVersion": "ES2022",
"webFeatureId": "object-hasown",
"sampleFile": "samples/es2022/object-has-own.js",
"functionName": "demoObjectHasOwn",
"compatKey": "javascript.builtins.Object.hasOwn",
"category": "api",
"tsTarget": null,
"tsLib": "es2022.object",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "array-prototype-findlast",
"name": "Array.prototype.findLast",
"description": "Iterates through an array in reverse order to find the value of the first element satisfying the predicate.",
"esVersion": "ES2023",
"webFeatureId": "array-findlast",
"sampleFile": "samples/es2023/array-find-last.js",
"functionName": "demoArrayFindLast",
"compatKey": "javascript.builtins.Array.findLast",
"category": "method",
"tsTarget": null,
"tsLib": "es2023.array",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "array-prototype-findlastindex",
"name": "Array.prototype.findLastIndex",
"description": "Iterates through an array in reverse order to find the index of the first element satisfying the predicate.",
"esVersion": "ES2023",
"webFeatureId": "array-findlast",
"sampleFile": "samples/es2023/array-find-last-index.js",
"functionName": "demoArrayFindLastIndex",
"compatKey": "javascript.builtins.Array.findLastIndex",
"category": "method",
"tsTarget": null,
"tsLib": "es2023.array",
"tsBelowTargetBehavior": "untouched",
"tsHelpers": []
},
{
"id": "class-fields",
"name": "Class Fields",
"description": "Extends classes with declarative instance and static fields without requiring constructor initialization, along with truly private members (fields and methods) prefixed with `#` that cannot be accessed outside the class body.",
"esVersion": "ES2022",
"webFeatureId": "class-syntax",
"sampleFile": "samples/es2022/class-fields.js",
"functionName": "Counter",
"compatKey": "javascript.classes.public_class_fields",
"category": "syntax",
"tsTarget": "es2022",
"tsLib": null,
"tsBelowTargetBehavior": "downlevel-helper",
"tsHelpers": [
"__classPrivateFieldGet",