Q. In JavaScript the x===y statement implies that:

  • (A) Both x and y are equal in value, type and reference address as well.
  • (B) Both are x and y are equal in value only.
  • (C) Both are equal in the value and data type.
  • (D) Both are not same at all.
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both are equal in the value and data type.

Q. Choose the correct snippet from the following to check if the variable "a" is not equal the "NULL":

  • (A) if(a!==null)
  • (B) if (a!)
  • (C) if(a!null)
  • (D) if(a!=null)
πŸ’¬ Discuss
βœ… Correct Answer: (A) if(a!==null)

Q. Suppose we have a text "human" that we want to convert into string without using the "new" operator. Which is the correct way from the following to do so:

  • (A) toString()
  • (B) String(human)
  • (C) String newvariable="human"
  • (D) Both human.toString() and String(human)
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both human.toString() and String(human)

Q. See the given code of JavaScript and choose the correct output from the following:

Code:
functioncomparing()  
{  
intx=9;  
chary=9;  
if(x==y)  
returntrue;  
else  
returnfalse;  
}  
  • (A) compilation error
  • (B) false
  • (C) runtime error
  • (D) true
πŸ’¬ Discuss
βœ… Correct Answer: (D) true

Q. What will be the output of the following JavaScript code?

Code:
functioncomparison()  
{  
int number=10;  
if(number==="10")  
returntrue;  
else  
returnfalse;  
}  
  • (A) True
  • (B) false
  • (C) runtime error
  • (D) compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. Find out the correct output of the following given piece of code from the given options:

Code:
functionfun()  
{  
int y=10;  
char z=10;  
if(y.tostring()===z)  
returntrue;  
else  
returnfalse;  
}  
  • (A) logical error
  • (B) false
  • (C) runtime error
  • (D) true
πŸ’¬ Discuss
βœ… Correct Answer: (D) true

Q. What is the basic purpose of the "toLocateString()" method?

  • (A) It returns a localised object representation
  • (B) It returns a localized string representation of the object
  • (C) It return a local time in the string format
  • (D) It return a parsed string
πŸ’¬ Discuss
βœ… Correct Answer: (B) It returns a localized string representation of the object

Q. What kind of work is being performed in the following given part of JavaScript's code?

Code:
<script>  
  
o = {x:1, y:{z:[false,null,""]}};   
s = JSON.stringify(o);   
p = JSON.parse(s);  
</script>  
  • (A) Object Encapsulation
  • (B) Object Encoding
  • (C) Object Abstraction
  • (D) Object Serialization
πŸ’¬ Discuss
βœ… Correct Answer: (D) Object Serialization

Q. A set of unordered properties that, has a name and value is called______

  • (A) String
  • (B) Array
  • (C) Serialized Object
  • (D) Object
πŸ’¬ Discuss
βœ… Correct Answer: (D) Object

Q. A collection of elements of the same data type which may either in order or not, is called

  • (A) String
  • (B) Array
  • (C) Serialized Object
  • (D) Object
πŸ’¬ Discuss
βœ… Correct Answer: (B) Array