trim whitespace from array of string js code example Example: javascript trim spaces value = value.trim();