Login and Register ×
Check your Email for the OTP
JavaScript MCQ Javascript String MCQ
⚠ Report ✓ Question Verified Copy Link
const str = 'Hello, world!'; console.log(str.substring(7, 12));
Explanation:
The substring() method returns the characters in a string between two specified indices. In this case, the indices are 7 and 12, so the method returns the characters from index 7 up to but not including the character at index 12, which is 'world'.
substring()
Related Topic:
Share Above MCQ
Learn More MCQ Questions from JavaScript MCQ Javascript String MCQ