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.charAt(str.length - 1));
Explanation:
The charAt() method returns the character at a specified index in a string. In this case, the index is the length of the string minus 1, which is the last character of the string, '!'.
charAt()
Related Topic:
Share Above MCQ
Learn More MCQ Questions from JavaScript MCQ Javascript String MCQ