Strings In Depth13 / 18
Up next

Trim whitespace

const raw = "   spaced   ";
// trim removes surrounding whitespace only
console.log(`[${raw.trim()}]`);
What you're solving

strip leading and trailing spaces