In Javascript the trim() method removes whitespace from both sides of a string.So today we discuss how to do remove whitespaces from string.