Which of the following lines is correct?...
if (typeof value == 'boolean') { return value; }
... or ...
if (typeof value === 'boolean') { return value; }
I thought the double equal sign was a type of "soft compare" so the value
variable could either be a string
or formal type. Is this not so? I wonder because JSHint complained about the first version. I've changed it but now I'm worried that typeof
won't return a string.