我对一个简单的 if
语句感到沮丧。我收到一个错误
TypeError: Undefined is not a function
我做错了什么?
if (typeof lCost !== "undefined")
totalExpenses = +totalExpenses + +lCost.isFixed(2);
最佳答案
if( typeof lCost !== "undefined" )
{
totalExpenses = +totalExpenses + +lCost.toFixed(2);
}
如果我没记错的话,isFixed 不是内置函数
关于javascript - 类型错误 : Undefined is not a function in simple if statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23519250/