Skip to content

Instantly share code, notes, and snippets.

@smashah
Last active June 26, 2020 16:39
Show Gist options
  • Save smashah/907d9eab91d33e7440ce520230703ba1 to your computer and use it in GitHub Desktop.
Save smashah/907d9eab91d33e7440ce520230703ba1 to your computer and use it in GitHub Desktop.
peepeepoopoo.js
const p =['oo','ee'];
export const pp = p.slice(0).reverse().map(p=>`p${p} `.repeat(p.length).trim()).join(' ')
//"pee pee poo poo"
console.log(`p${p[1]} p${p[1]} p${p[0]} p${p[0]}`)
//"pee pee poo poo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment