我在JS创建此工具方法的对象:检查BOOL正在检查,而不是
function IsAuthenticated(userID)
{
var isAuthed = false;
if (userID.length == 0)
return false;
// more logic
if(SomeLogic)
isAuthed = true;
return isAuthed;
}
当我运行这样的事情,我发现了一个对象返回,而不是bool类型:
if(IsAuthenticated)
//code here
我想我需要将它投射到布尔?
抱歉张贴错误我有回报。 – PositiveGuy 2010-07-19 20:47:42
您需要开始发布真实的代码,而不是浪费人们的时间。删除我的答案,而不是回到这个问题。祝你好运。 – 2010-07-19 21:52:06
我不喜欢他们的鼻子在空中开发。让我们这样说吧。 – PositiveGuy 2010-07-19 22:59:59