String strip() for JavaScript? [duplicate]
This question already has answers here: Trim string in JavaScript? (20 answers) Closed 6 years ago. What’s a clean and efficient JavaScript implementation to strip leading and trailing spaces from a string? For example: ” dog” “dog ” ” dog ” ” dog ” all get turned into “dog” 8 Answers 8