I think this was posted purely for the limerick quality.
There was a young coder whose hacks
His manager often claimed lacked
The requisite clarity
For to clamp vars would he:
Math.min(Math.max(number, min), max); @jaffathecake had a problem of truncation
and posted to Twitter his calculation.
The gist of his attack
was min( max( num, min ), max)
yet refused to add any annotation.near get(), post(), and ajax()
// we alias at import
// to keep all the code short
min(max(number, min), max)
Cryptic sorcerer!
"Math.min(Math.max(v, min), max);"
his incantation.