koehr.ing/content/til/2024-09-06.md
Norman Köhring 2e916d5111 update TIL
2024-09-06 13:33:13 +02:00

17 lines
351 B
Markdown

---
{
.title = "Javascript's Array.from is neat!",
.date = @date("2024-09-06T00:00:00"),
.author = "koehr",
.draft = false,
.layout = "til.html",
.description = "",
.tags = [],
.custom = {},
}
---
Because it simply executes a function arg1.length times, one can do things like:
```ts
const randomNumbers = Array.from({ length: 75 }, Math.random)
```