Timeline for Replace all items with their counts
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 18, 2023 at 5:45 | comment | added | tsh | @kamoroso94 There is another JS answer posted by Arnauld using the similar approach. | |
Jan 18, 2023 at 4:45 | comment | added | kamoroso94 |
a=>a.map(x=>a.filter(y=>x==y).length) (37 bytes) would be a better substitute for the second solution.
|
|
Apr 22, 2021 at 3:52 | history | edited | tsh | CC BY-SA 4.0 |
added 64 characters in body
|
Apr 22, 2021 at 3:46 | comment | added | tsh | @RedwolfPrograms flatMap will flat as soon as the array returns, not flat after map. <del>maybe we need a proposal about Array#mapFlat API to JavaScript.</del> | |
Apr 22, 2021 at 3:43 | comment | added | rydwolf |
Can't you use flatMap ?
|
|
Apr 22, 2021 at 2:46 | history | edited | tsh | CC BY-SA 4.0 |
edited body
|
Apr 22, 2021 at 2:39 | history | edited | tsh | CC BY-SA 4.0 |
edited body
|
Apr 22, 2021 at 2:34 | comment | added | tsh |
@RedwolfPrograms Yes. ||= , &&= and ??= are ES2021 features. Logical ||= and &&= are also supported by ActionScript (ES4) long long ago.
|
|
Apr 22, 2021 at 2:29 | comment | added | rydwolf |
Is ||= a ES2021 feature? I don't remember seeing that before.
|
|
Apr 22, 2021 at 2:27 | history | edited | tsh | CC BY-SA 4.0 |
added 9 characters in body
|
Apr 22, 2021 at 2:21 | history | answered | tsh | CC BY-SA 4.0 |