![](/img/trans.png)
[英]Cannot read property 'path' of undefined, can anybody please help me to resolve this
[英]throwing error as undefined can aonyone help me with it please
const calcTip = function (bill){ if (bill>=50) { bill*.15 } else {(bill<=300) bill*.20 } }; console.log(calcTip(50));
因为没有暗示return
。 添加return
。 喜欢,
const calcTip = function (bill){ if (bill>=50) { return bill*.15 } else { // (bill<=300) return bill*.20 } }; console.log(calcTip(50));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.