javascript - Check for bool is checking for an object instead -


I have created this utility method in JS:

  isAuthenticated (userID) function {Html> 

Var is latent = false; If (userID.length == 0) incorrect return; // More logic if (SomeLogic) is quoted = true; The return is; }

When I run something like this, I am typing bool instead of an object back:

  if (isAuthenticated) // Code here  

I think I need to put it in a bowl?

refers to function called "asset-accredited" And do not have a function call. If you use IsAuthenticated on the typeof operator, then you "function" :

  alert ( Typeof isAuthenticated);  

So try this instead:

  var user id = / * ... * /; If (ESER (user ID)) {// code here}  

Comments