js remove spaces before and after every emtry code example Example: js remove space before string var str = " Some text "; str.trim(); // str = "Some text"