- A calculates the area of a circle
- B converts a string to uppercase
- C checks if a string is a palindrome
- D sorts an array in ascending order
- Share this MCQ
Answer:
C
Share this MCQ
This function takes in a single argument, str
, and uses the toLowerCase()
method to convert the string to lowercase.
It then uses the split()
, reverse()
, and join()
methods to check if the string is a palindrome (i.e., it reads the same forwards and backwards).
Share this MCQ