Negative Infinity Value –
Even if you compare with zero or less than zero, negative infinity value is always a winner.
Compare any positive value either number or float, infinity always win.
It’s all about does they return true or false to if.
Then, we are putting a 0 in if condition. I hope you already know the answer of this statement.
Take a deep breath and think the solution of it.
Now, you know the answer is “+ve” & “-ve“. But you have to know this also that why it gives “+ve” & “-ve” console.
So, let’s start with the first conditional statement which is Infinity. As it’s always a greater value and a positive number is always returned truthy.
That’s why we get our first console answer is “+ve“.
Last but not the least, -Infinity value what it returns as it’s less than any value means it’s lesser than 0. So, doesn’t it return false.
I hope you enjoy this. But wait here is something more for you.
- FIND OUT THE OUTPUT OF A REVERSE STRING
- DOES DELETE OPERATOR REALLY WORK ON THE PRIMITIVES
And last but not the least, don’t forget to like, comment and share. It gives us a morale boost to remain to continue. Also, join our Facebook Page
If you have any questions, please feel free to ask me in the comment section and also let me know if you have any suggestions. As suggestions are always welcome.