Javascript : Detect duplicate value in array and delete the first one if only one field changes
<p>I need to transform this array in Javascript :</p>

<pre><code>[{"catalog_ref":"OFFER230","level_order":4},
 {"catalog_ref":"OFFER231","level_order":4},
 {"catalog_ref":"OFFER232","level_order":4},
 {"catalog_ref":"OFFER233","level_order":4},
 {"catalog_ref":"OFFER234","level_order":4},
 {"catalog_ref":"OFFER235","level_order":5},
 {"catalog_ref":"OFFER236","level_order":5},
 {"catalog_ref":"OFFER232","level_order":5},
 {"catalog_ref":"OFFER233","level_order":5},
 {"catalog_ref":"OFFER234","level_order":5}]
</code></pre>

<p>To this array :</p>

<pre><code>[{"catalog_ref":"OFFER230","level_order":4},
 {"catalog_ref":"OFFER231","level_order":4},
 {"catalog_ref":"OFFER235","level_order":5},
 {"catalog_ref":"OFFER236","level_order":5},
 {"catalog_ref":"OFFER232","level_order":5},
 {"catalog_ref":"OFFER233","level_order":5},
 {"catalog_ref":"OFFER234","level_order":5}]
</code></pre>

<p>I've tried a lot of things and I didn't find a solution. Can someone help me ? I need to keep this order in the new array</p>