29
29
30
30
---
31
31
32
- [ * Example of usage* ] ( https://tinyurl.com/2mknex43 ) :
32
+ [ * Example of usage* ] ( https://tinyurl.com/28zqjbun ) :
33
33
``` js
34
34
import ' core-js/actual' ;
35
35
36
- Promise .resolve ( 42 ).then (it => console .log (it)); // => 42
36
+ Promise .try (() => 42 ).then (it => console .log (it)); // => 42
37
37
38
38
Array .from (new Set ([1 , 2 , 3 ]).union (new Set ([3 , 4 , 5 ]))); // => [1, 2, 3, 4, 5]
39
39
40
40
[1 , 2 ].flatMap (it => [it, it]); // => [1, 1, 2, 2]
41
41
42
- ( function * (i ) { while (true ) yield i++ ; })( 1 )
42
+ Iterator . concat ([ 1 , 2 ], function * (i ) { while (true ) yield i++ ; }( 3 ) )
43
43
.drop (1 ).take (5 )
44
44
.filter (it => it % 2 )
45
45
.map (it => it ** 2 )
@@ -57,13 +57,13 @@ import 'core-js/actual/array/from';
57
57
import ' core-js/actual/array/flat-map' ;
58
58
import ' core-js/actual/structured-clone' ;
59
59
60
- Promise .resolve ( 42 ).then (it => console .log (it)); // => 42
60
+ Promise .try (() => 42 ).then (it => console .log (it)); // => 42
61
61
62
62
Array .from (new Set ([1 , 2 , 3 ]).union (new Set ([3 , 4 , 5 ]))); // => [1, 2, 3, 4, 5]
63
63
64
64
[1 , 2 ].flatMap (it => [it, it]); // => [1, 1, 2, 2]
65
65
66
- ( function * (i ) { while (true ) yield i++ ; })( 1 )
66
+ Iterator . concat ([ 1 , 2 ], function * (i ) { while (true ) yield i++ ; }( 3 ) )
67
67
.drop (1 ).take (5 )
68
68
.filter (it => it % 2 )
69
69
.map (it => it ** 2 )
@@ -81,13 +81,13 @@ import from from 'core-js-pure/actual/array/from';
81
81
import flatMap from ' core-js-pure/actual/array/flat-map' ;
82
82
import structuredClone from ' core-js-pure/actual/structured-clone' ;
83
83
84
- Promise .resolve ( 42 ).then (it => console .log (it)); // => 42
84
+ Promise .try (() => 42 ).then (it => console .log (it)); // => 42
85
85
86
86
from (new Set ([1 , 2 , 3 ]).union (new Set ([3 , 4 , 5 ]))); // => [1, 2, 3, 4, 5]
87
87
88
88
flatMap ([1 , 2 ], it => [it, it]); // => [1, 1, 2, 2]
89
89
90
- Iterator .from ( function * (i ) { while (true ) yield i++ ; }(1 ))
90
+ Iterator .concat ([ 1 , 2 ], function * (i ) { while (true ) yield i++ ; }(3 ))
91
91
.drop (1 ).take (5 )
92
92
.filter (it => it % 2 )
93
93
.map (it => it ** 2 )
0 commit comments