Using function's return value in if statement

前端 未结 5 1039
你的背包
你的背包 2021-02-09 05:54

Hopefully a quick question here.

Can you use a function\'s returned value in a if statement? I.e.

function queryThis(request) {

  return false;

}

if(q         


        
5条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 06:01

    This should not be a problem. I don't see anything wrong with the syntax either. To make sure you could catch the return value in a variable and see if that solves your problem. That would also make it easier to inspect what came back from the function.

提交回复
热议问题