MCQ Single Best Answer Not Set

QWhat does the substring() function do in JavaScript?

ID: #4870 Javascript Functions MCQ 203 views
Question Info
#4870Q ID
Not SetDifficulty
Javascript Functions MCQTopic

Choose the Best Option

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

  • A Extracts a part of a string
  • B Replaces a part of a string with a new string
  • C Concatenates two strings
  • D None of these
Correct Answer: Option A

Explanation

The substring() function extracts a part of a string and returns a new string.
It takes two arguments: the start index and the end index (optional).
The extracted part includes the characters from the start index to the end index (not including the character at the end index).

Share This Question

Challenge a friend or share with your study group.