title: Most compact way to check if a javascript variable is a string and then trim it?
body: <p>I could do:</p>
  
  <pre><code>let value = array[index];
  if (typeof value === 'string') {
      value = value.trim();
  }
  </code></pre>
  
  <p>Just curious if there is a there is a more compact way to do this?    </p>