Linter said not to nest ternaries so I mixed in if statements:
const onHideButton = type => {
if (hideButton === null) {
return sudo ? onParentHideButton(type)
: !sudo ? true : undefined
} else {
return hideButton ? undefined
: onParentHideButton(type)
}
I write a script called "d" to deploy to prod, then realized I could golf the one character name down to zero! I have since mapped the F3 key to deploy to production. Very satisfying code golfing, plus it cuts our time to launch deployments by 50%
Fortunately the JavaScript floor operator ~~ is idempotent so you can repeat it often to make those important type conversions easy to find at a glance
console.log(~~~~~~~~~~~~~~~~(100/7))
Writing `def draw() ...` then `g.draw = draw` felt redundant and wasted a line of code so I fixed it
g.draw = lambda: \
g.background("skyblue") and \
g.fill("yellow") and \
g.ellipse(g.width, 0, g.height / 2)
Y'all criticize JS for having both null and undefined but IDL takes this to another level, and !NULL is just one of some beautiful "constant variables" (check out the super descriptive !VALUES)