Typescript Array insert non-duplicate item
<p>We are in 2016, so, I would like to know the best way to insert a non-duplicate item into an array taking into account performance and clean code.</p>

<p>EDIT:</p>

<p>For example:</p>

<p>My object is:</p>

<pre><code>obj = {id: 1, a: 2, b: 3, c: 4}
</code></pre>

<p>My array arr:</p>

<pre><code>arr.push(obj);

arr.push(obj); // Avoid this duplicate obj
</code></pre>

<p>Thank you.</p>