I\'m using the below code to try to trim the string in Javascript but am getting the error mentioned in the title:
function trim(str) { return str.replac
You should use toString() Method of java script for the convert into string before because replace method is a string function.