title: how tp prevent duplication in an array
body: <p>As shown in the below posted code, the array arr wil contain obj.name and obj.text every time the function func is called.
  what at i want to know is, is there a recommended way in javascript to prevent the array from having the same obj.name and obj.text more than once?</p>
  
  <p><strong>note</strong>: the function func contains the object obj but actually it has more than two properties</p>
  
  <p>please let me know the recommended way in javascript to prevent duplicate entries to the array
  <strong>code</strong></p>
  
  <pre><code>  func(obj) {
  
    obj.name = name;
    obj.text = text;
  
    arr.push(obj);
    }
  </code></pre>