summaryrefslogtreecommitdiff
path: root/u/leftpadesque/prepend.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <lizhunt@amazon.com>2025-05-13 18:58:45 -0700
committerElizabeth Hunt <lizhunt@amazon.com>2025-05-13 18:58:54 -0700
commit1d66a0f58e4ebcdf4f42c9d78f82a1ab49a2cf11 (patch)
tree07073c060b61688e4635fd4658315cc683589d3d /u/leftpadesque/prepend.ts
parent2543ac8b11af11f034836591046cdb52911f9403 (diff)
downloadci-1d66a0f58e4ebcdf4f42c9d78f82a1ab49a2cf11.tar.gz
ci-1d66a0f58e4ebcdf4f42c9d78f82a1ab49a2cf11.zip
snapshot!
Diffstat (limited to 'u/leftpadesque/prepend.ts')
-rw-r--r--u/leftpadesque/prepend.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/u/leftpadesque/prepend.ts b/u/leftpadesque/prepend.ts
new file mode 100644
index 0000000..9b77aff
--- /dev/null
+++ b/u/leftpadesque/prepend.ts
@@ -0,0 +1,4 @@
+export const prependWith = (arr: string[], prep: string) =>
+ Array(arr.length * 2).fill(0)
+ .map((_, i) => i % 2 === 0)
+ .map((isPrep, i) => isPrep ? prep : arr[i]);