title: Pass object into function as parameter in Javascript
body: <p>In C/C++ I know we had pointers to objects and arrays, so they could be passed into function parameters without the need to clone said objects and arrays. In Javascript there's no such option, so we just use the object variable. </p>
  
  <p>Is this good practise?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function setWhite(obj){
    obj.color = "white";
  }
  
  var shirt = {
    color: "red",
    size: "L"
  }
  
  setWhite(shirt);
  
  console.log(shirt);</code></pre>
  </div>
  </div>
  </p>