Single Choice
Easy
QWhat is the result of the following code?
var str = "Hello World!";
console.log(str.endsWith("World!"));
ID: #4901
Javascript String MCQ
199 views
Question Info
#4901Q 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 endsWith method in JavaScript is a method that can be called on a string value to determine whether the string ends with the specified string.
In this case, the endsWith method is called on the string "Hello World!", with the string "World!" as the argument.
Since the string "Hello World!" does end with the string "World!", the endsWith method will return true.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic