Sunday, 18 March 2018

Explain why '+[] == 0' output 'true' in Javascript?

Explain why +[] == 0 give output 'true' in Javascript?



Please, check example.






+[] == 0 ? alert(true) : alert(false);





And also check.
'1+[+[]]' give output '10'

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...