toPositive.js 92 Bytes edit raw blame history 1 2 3 module.exports = function toPositive(number) { return number < 0 ? 0 : (+number || 0); };