JavaScript MCQ JavaScript Operator MCQ Question #4898
Single Choice Easy

QWhat is the result of the following code?
var x = "Hello";
var y = "World";
console.log(x in y);

ID: #4898 JavaScript Operator MCQ 195 views
Question Info
#4898Q ID
EasyDifficulty
JavaScript Operator MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A true
  • B false
  • C "true"
  • D "false"
Correct Answer

Explanation

The in operator in JavaScript is used to determine whether an object has a particular property.
In this case, the in operator is called on x and y, with x as the left operand and y as the right operand.
Since y is a string and does not have any properties, the in operator will return false.

Share This Question

Challenge a friend or share with your study group.