How to trim variables without erring if the var is empty?
<p>I'm using the following for event tracking:</p>

<pre><code>var dataTrack = e.split(','); // split by comma

if (dataTrack !== undefined) {

    var action = dataTrack[0];
    var values = {};
    values[dataTrack[1]] = dataTrack[2];

    mpq.track(action, values);
}
</code></pre>

<p>How can I trim dataTrack[0], dataTrack[1], dataTrack[2] in a way where if any of the dataTrack vars are empty it won't break? 1 &amp; 2 are optional...</p>

<p>Thanks</p>
