4 ms·
Minimal JS Integer Framework: function plusOne(x) { return x + 1 } function plusTwo(x) { return x + 2 } function plusThree(x) { return x + 3 }
by tzahola 8y ago
Minimal JS Integer Framework:
function plusOne(x) { return x + 1 }
function plusTwo(x) { return x + 2 }
function plusThree(x) { return x + 3 }
function plusFour(x) { return x + 4 }
Using this framework, you can truly adhere to the DRY principle: instead of repeating x++ all around your codebase, you can simply do:
x = plusOne(x)