Timeline for Make a list flat
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 14, 2022 at 19:04 | comment | added | Asleepace | @DomHastings oooooh nice, just updated the answer, thanks! | |
| Jun 14, 2022 at 19:04 | history | edited | Asleepace | CC BY-SA 4.0 |
added 77 characters in body
|
| Jun 14, 2022 at 13:07 | comment | added | Dom Hastings | You can save a couple more bytes re-ordering the conditional check: Try it online! | |
| Jun 8, 2022 at 17:35 | comment | added | naffetS |
@AjitPanigrahi That doesn't work, you instead need a.map?.(). Try it online!
|
|
| Jun 8, 2022 at 11:59 | comment | added | Ajit Panigrahi |
Instead of ternary, you can write a?.map(i=>f(i,c))??c.push(a) -- Assuming ?. & ?? operators are supported/allowed. Saves 4 characters.
|
|
| Jun 7, 2022 at 18:45 | history | edited | Asleepace | CC BY-SA 4.0 |
added 93 characters in body
|
| Jun 7, 2022 at 4:55 | comment | added | Matthew Jensen |
-21 bytes, you can check whether a is an array by testing the truthiness of a.map, you also don't need the .flat() or |c in there. You've also got a trailing space :)
|
|
| Jun 7, 2022 at 0:23 | history | answered | Asleepace | CC BY-SA 4.0 |