Find words which contains more than 3 e vowels: Difference between revisions
Content added Content deleted
(Added a JavaScript version) |
m (→{{header|JavaScript}}: Flipped order of a pair of names, for readability) |
||
Line 1,251: | Line 1,251: | ||
// and none of its vowels are other than "e". |
// and none of its vowels are other than "e". |
||
const |
const |
||
[ |
[noOtherVowels, eCount] = [...w].reduce( |
||
([ |
([bool, n], c) => bool |
||
? "e" === c |
? "e" === c |
||
? [1 + n |
? [bool, 1 + n] |
||
: "aiou".includes(c) |
: "aiou".includes(c) |
||
? [ |
? [false, n] |
||
: [ |
: [bool, n] |
||
: [ |
: [false, n], |
||
// Initial accumulator. |
// Initial accumulator. |
||
[ |
[true, 0] |
||
); |
); |
||