strip beginning end spaces javascript code example Example: javascript trim spaces value = value.trim();