+ 11
Does output "1" means "true" here?
https://code.sololearn.com/WNBj07dT4lS0/?ref=app I know that true=1,false=0. But , is the answer 1 means true only here or not,i have this doubt Plz explain
7 Antworten
+ 5
Yes, in binary, 1 and 0 equal true and false, the plus sign in the bracket makes sure that the value returned is a number, number 1
If you change == to !=, It will return false!
+ 4
Answer came 1 because of +
alert(typeof a==b);
it returns TRUE
alert(+(typeof a==b));
Here + operator converts TRUE into
integer value 1
+ 4
Vachila64☕
Yeah!😁
Both the answers are same and deserve to be the best answer but i also got confused to mark which one ,so i just marked Bhargava Ram's answer.
If you want your answer to be marked ,i am marking it😁😉
And i think it should be also cause you only answered first
Thank you☺️💗
+ 3
Bhargava Ram Lol, that is exactly what i said?!! 😂😅😂
+ 3
Mr lol Vachila64☕
I'm not said any you answer is right or wrong ,
even I'm not seen your answer
I just given my point of explanation
Got it ?!!
+ 3
Yes
+ 2
Bhargava Ram Lol, I was just saying that we were saying the same thing, that's all😅
maybe you could have said something a bit different cos it is a bit like repition
Ashwin Maurya I didn't mean for you to mark mine as best , I just wanted to tell Mr Bhargawa that the answers were the same😅, but thank you anyways 😅