I´m really confused. Maybe anyone can help me? The problem is the following:
var isSignInside = new Boolean(someCondition);
if (!isSignInside) {
//doStuff
}
else {
//doOtherStuff
}
Now, if isSignInside
is false
(the debugger told me), the script still jumps to //doOtherStuff
. How can this be?
The rest of the snippet isn´t of relevance, but I can share it if asked.
Surely there is an easy explanation i don´t see. Thanks in advance.
Edit:
The someCondition really is a custom method "forced" to return a bool instead of (otherwise) a string.
Edit: Just used the function directly in the if. Needed some tricky paranthesis, but works now. Thanks for the hint that a (boolean) object can never be === to a static boolean primitive. Hell this forum is fast.