showStorage.js 306 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /** * 显示剩余库存 * @param {[Number]} leftNumber * @return {[boolen]} */ module.exports = function(leftNumber) { leftNumber = +leftNumber; if (leftNumber <= 3 && leftNumber >= 0) { return '余量有限'; } else if (leftNumber < 0) { return '库存不足'; } };