toPositive.js 92 Bytes Edit Raw Blame History 1 2 3 module.exports = function toPositive(number) { return number < 0 ? 0 : (+number || 0); };