- Joined
- Apr 24, 2008
- Messages
- 17,844
- Likes received
- 990
- Thanks received
- 182
Found the above in a line of javascript which I am not that great on.
Is there any reason to do this? Am I missing something? Some js trick?
Or can we just put this down to offshore devs?
It means - if isError exists then keep it the same, otherwise set it to false.
Does that not only work if isError is a boolean? I.e. the || operator is a boolean operator, it can only be true or false, and I'll take your word for it that undefined || false == false. But it wouldn't work if isError was 5.7.
I would have done isError == undefined ? false : isError;
Which says what it means, rather than some wierd script kiddyish hackery.

if (truthiness)
{
doUpdation();
}


