js trim input value code example
Example 1: remove whitespace javascript
var str = " Some text ";
str.trim();
Example 2: javascript remove first space in string
//use trim() on your string. It removes first and last whitepsaces
let str = " aa bb ";
console.log(str.trim()); // "aa bb"