Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
set.add(“1”);
set.add(“2”);
document.writeln(set.has(“3”));

What will be the output of the following JavaScript code?
set.add(“1”);
set.add(“2”);
document.writeln(set.has(“3”));
a) 3
b) True
c) false
d) 2

Answer: c
Explanation: The Set has() method indicates whether the Set object contains the specified value. It returns true if the specified value is present, otherwise false.

Join The Discussion