After the following code, what is the message displayed to the user?
let
firstName = null
;
let
lastName = null
;
let
nickName = "Supercoder";
alert(
firstName ?? lastName ?? nickName ?? "Anonymous")
;
After the following code, what will be the value of 'tallEnough'?
let
height = 0;
tallEnough = (height || 100);
After the following code, what will be the value of 'words'?
var
words = (a() && b())
function
a(){return
"hello";}
function
b(){return
"world";}
What is the correct way to rewrite the following function using arrow functions?
let
sum = function
(a, b) {
return
a + b;
};
After the following code, what will be the value of 'd'?
let
logicAnd = (a, b) => a && b;
let
logicValid = (a, b) => a ?? b;
let
logicOr = (a, b) => a || b;
function
maths(a, b, c) {
return
(logicOR(a, b) + logicAnd(a, b) + logicValid(c, b));
}
let
a = 1;
let
b = 2;
let
c = 0;
let
d = maths(a, b, c);
Which of the following is NOT valid?