Aug 22, 2017 · 1 min read
This:
const preciseOperation = f => (a, b, decimalDigits) => {
decimalDigits = decimalDigits || 12
+(f(a, b)).toFixed(decimalDigits)
}
Can turn to this:
const preciseOperation = f => (a, b, decimalDigits = 12) => +(f(a, b)).toFixed(decimalDigits)
Maybe a bit too long for a single line. But I like it :)
Otherwise awesome article bro
