Javascript's Array.from is neat!
+ ++ Last updated: +
Because it simply executes a function arg1.length times, one can do things like:
const randomNumbers = Array.from({ length: 75 }, Math.random)
+
+-
+
+
diff --git a/content/til/2024-09-06.md b/content/til/2024-09-06.md new file mode 100644 index 0000000..7e8021c --- /dev/null +++ b/content/til/2024-09-06.md @@ -0,0 +1,17 @@ +--- +{ +.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) +``` diff --git a/zig-out/til/2024-09-06/index.html b/zig-out/til/2024-09-06/index.html new file mode 100644 index 0000000..4a7d507 --- /dev/null +++ b/zig-out/til/2024-09-06/index.html @@ -0,0 +1,128 @@ + + + +
+ +Because it simply executes a function arg1.length times, one can do things like:
const randomNumbers = Array.from({ length: 75 }, Math.random)
+
+