What is the purpose of the trim() method in JavaScript?
trim()
Reverses the characters in a string.
Converts a string to all uppercase letters.
Converts a string to all lowercase letters.
Removes whitespace from both ends of a string.