Single Choice
Easy
QWhat is the result of the following code?
var str = "Hello World!";
console.log(str.includes("World"));
ID: #4902
Javascript String MCQ
211 views
Question Info
#4902Q ID
EasyDifficulty
Javascript String MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The includes method in JavaScript is a method that can be called on a string value to determine whether the string includes the specified string.
In this case, the includes method is called on the string "Hello World!", with the string "World" as the argument.
Since the string "Hello World!" does include the string "World", the includes method will return true.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic