function importedStock(raw) { return Number(raw) || 100; } console.log(importedStock("0"), importedStock("bad"));