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
num=35; num.replace(3,'three'); =====> ERROR
num=35; num.toString().replace(3,'three'); =====> CORRECT !!!!!!
num='35'; num.replace(3,'three'); =====> CORRECT !!!!!!