title: How to add a Property Name and Value to a JavaScript Object using a function?
body: <pre><code>var a = "the letter a";
  var obj = {};
  
  obj.brovo = "the letter b";
  obj.charlie = "the letter c";
  
  if (!obj.alpha) obj.alpha = a;
  </code></pre>
  
  <p>Since I wish to use this at different points in my code and will be using it multiple times I wish for it to be used as the following:</p>
  
  <pre><code>isNotSet(obj.alpha, a);
  </code></pre>
  
  <p>I wish this to equate <code>obj.alpha = a;</code></p>
  
  <p>I started with the following function:</p>
  
  <pre><code>function isNotSet (arg1, arg2) {
      if (!arg1) arg1 = arg2;
      return arg1;
  }
  </code></pre>