I really do not know how this is possible, and I could not reproduce the error in a simplified environment, say, JSFiddle. But here is how it looks in my application.
I am trying to convert a value that can be "True", "False" or "something else" string to boolean if it is either True or False. In most cases, it works very well (although they can be a smoother conversion method), as shown in the image below.

however, sometimes it fails, and the value of the clock shows the following:

So, a string variable with the value "True" is not equal to the string literal "True". I'm lost. How is this possible? What am I missing here?
Thanks in advance
source