Q. What is the difference between the two lines given below ?
Code:
!!(object1 && object2);
(object1 && object2);
-
(A)
Both the lines checks just for the existence of the object alone
-
(B)
The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
-
(C)
Both the lines result in a boolean value “False”
-
(D)
Both the lines result in a boolean value “True”
β
Correct Answer: (B)
The first line results in a real boolean value whereas the second line merely checks for the existence of the objects