function timeoutMs(value) { return value || 5000; } console.log(timeoutMs(undefined)); console.log(timeoutMs(0));