Post History
JavaScript (V8), 32 bytes f=n=>[...Array(n).keys()].map(f) Try it online! Somehow it doesn't recurse forever at n=0. Pretty nice.
Answer
#2: Post edited
- # [JavaScript (V8)], 32 bytes
- <!-- language-all: lang-javascript -->
- f=n=>[...Array(n).keys()].map(f)
[Try it online!][TIO-ko185frw]- [JavaScript (V8)]: https://v8.dev/
[TIO-ko185frw]: https://tio.run/##BcGxCoMwEADQX3G8Q3q4FASbgquDDh2lQ5CcXI2JXIKQr0/f@9nbpk3lyo@7r5VNMO@ViEZVWyAgHa4kwC@d9gLGylHBu9yI6QZ5PQdpW9xiSNE78nGH6bPMlLJK2IULMAgi1j8 "JavaScript (V8) – Try It Online"- Somehow it doesn't recurse forever at n=0. Pretty nice.
- # [JavaScript (V8)], 32 bytes
- <!-- language-all: lang-javascript -->
- f=n=>[...Array(n).keys()].map(f)
- [Try it online!][TIO-ko186yep]
- [JavaScript (V8)]: https://v8.dev/
- [TIO-ko186yep]: https://tio.run/##BcGxCoMwEADQXylOd2gPF0HQFLp2qEPH4hAkJ9emiVyCkK9P3/vY06ZN5cjXc6yVTTC3NxHdVW2BgPR1JQGu9LMHMFaOCt7li5h@knmYpG1xiyFF78jHHaRrTNM9XsuTUlYJu3ABBkHE@gc "JavaScript (V8) – Try It Online"
- Somehow it doesn't recurse forever at n=0. Pretty nice.
#1: Initial revision
# [JavaScript (V8)], 32 bytes <!-- language-all: lang-javascript --> f=n=>[...Array(n).keys()].map(f) [Try it online!][TIO-ko185frw] [JavaScript (V8)]: https://v8.dev/ [TIO-ko185frw]: https://tio.run/##BcGxCoMwEADQX3G8Q3q4FASbgquDDh2lQ5CcXI2JXIKQr0/f@9nbpk3lyo@7r5VNMO@ViEZVWyAgHa4kwC@d9gLGylHBu9yI6QZ5PQdpW9xiSNE78nGH6bPMlLJK2IULMAgi1j8 "JavaScript (V8) – Try It Online" Somehow it doesn't recurse forever at n=0. Pretty nice.