What will be the output of the following JavaScript code?
int a=1;
if(a!=null)
return 1;
else
return 0;
a) runtime error
b) compiler error
c) 1
d) 0
Answer: c
Explanation: != is the not equal to operator. It gives a value of 1 if the two values which are compared are not equal and give 0 if the two values are equal.
Related Posts
The basic purpose of the toLocaleString() is to _________
Identify the process done in the following JavaScript code snippet?
o = {x:1, y:{z:[false,null,””]}};
s = JSON.stringify(o);
p = JSON.parse(s);The purpose of extensible attribute is to __________
What is the prototype represents in the following JavaScript code snippet?
function f() {};To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________
In the following syntax, the data type within the square brackets must be ___________
book[datatype]=assignment_value;A linkage of series of prototype objects is called as ________
Join The Discussion