You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
352 B
Plaintext
18 lines
352 B
Plaintext
2 weeks ago
|
---
|
||
|
{
|
||
|
.title = "Javascript's Array.from is neat!",
|
||
|
.date = @date("2024-09-06T00:00:00"),
|
||
|
.author = "koehr",
|
||
|
.draft = false,
|
||
4 days ago
|
.layout = "til.shtml",
|
||
2 weeks ago
|
.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)
|
||
|
```
|