Reputation: 2867
I just seen this code snippet: '' === '' ? null : ('' === '*' ? '*' : ('').split(','));
Is there ever a time in which '' === ''
is not true?
Upvotes: 2
Views: 119
Reputation: 664395
Is there ever a time in which
'' === ''
is not true?
No, there is not.
This whole code snippet doesn't make too much sense, my guess would be that it is dynamically generated code and the string literals are filled in with some kind of templating mechanism - in this case they were filled with the empty string. Of course the conditions should better have been evaluated in the generator, but maybe the used engine didn't support this.
Upvotes: 2