Skip to content

Instantly share code, notes, and snippets.

View areinmeyer's full-sized avatar

Allen Reinmeyer areinmeyer

View GitHub Profile
@areinmeyer
areinmeyer / verticalSlashes.js
Created November 22, 2022 16:36
Vertical Slashes solution in node
#!/usr/bin/env node
const input = process.argv.slice(2);
const slashes = String.raw`${input[0]}`;
let output = "";
const verticalSlashes = (count, input) => {
if (input.length === 0) return "";
const currSlash = input[0]
switch (currSlash) {
case "/":
@areinmeyer
areinmeyer / JSMapsPerfTesting.js
Last active March 11, 2020 20:20
Javascript Maps Insertion/Deletion speed versus Objects.
/**
Goal is a simple (naive?) test to show performance differences in Maps vs Objects.
**/
//Insert entries into Map
const start = Date.now()
let testmap = new Map()
for (let i = 0; i < 1000000; i++) {
testmap.set(i, i)
}