I'm wondering if it's possible to write the following as concisely as possible in Javascript/Typescript:
a = a.trim()
b = b.trim()
c = c.trim()
...
As a one-liner I can write it like this:
[a, b, c, ...] = [a, b, c, ...].map(s => s.trim())
But even this can get messy if we're attempting to do this with 10 or 20+ variables. My specific use case: I've extracted several fields from a document under various variable names and I want to clean up each one by trimming unnecessary whitespace from each. Is there a more concise way than those above?