DEV Community

Discussion on: JavaScript One-Liners That Make Me Excited

Collapse
 
kelerchian profile image
Alan
const makeMockingSpongebobMeme = (someString) => (typeof someString === "string" ? someString : "Wrong input").split("").map(a => Math.random() > 0.5 ? a.toLowerCase() : a.toUpperCase()).join("")

One of the intriguing trait of functional programming is to look unreadable despite being working.