JavaScript Associate — Easy
Key points
- trim() specifically targets leading and trailing spaces
- It does not affect spaces within the string
- The method returns a new string without modifying the original
- Useful for data validation and formatting
Ready to go further?
Related questions
