![](/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.