mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
15 lines
242 B
JavaScript
15 lines
242 B
JavaScript
// @noflow
|
|
|
|
// Array#reduce
|
|
|
|
[0,1].reduce((x,y,i) => y);
|
|
|
|
["a", "b"].reduce(
|
|
(regex, representation, index) => {
|
|
return regex + (index ? '|' : '') + '(' + representation + ')';
|
|
},
|
|
'',
|
|
);
|
|
|
|
[""].reduce((acc,str) => acc * str.length);
|