First split then slice value
<p>I know how to split a value using deliminators. I also know how to slice a value to remove the last couple chars. I need to combine these now, which is the part I can't figure out.</p>

<pre><code>    $("#product").val(value.split('|')[0]);
</code></pre>

<p>How would I add <code>slice(0,-1)</code> to this function above? I want it to first split, then slice.</p>

<p>So the result would be everything before the '|' and minus one char</p>

<p><strong>Solved:</strong></p>

<pre><code>$("#product").val(value.split('|')[0].slice(0, -1))
</code></pre>
