Is there a correct way of spacing in Javascript?
<p>In a preliminary technical interview, I was asked to write a <em>simple calculator function</em> in Javascript.  My code was passable but he commented on my <strong>bad spacing</strong>. I wrote something like this: </p>

<pre><code> var calc = function(num1, num2, operand){       //function(...  VS function (...
      if(operand === 'add'){                     
           return num1 + num2;
      } else if(operand === 'multiply'){         // if(...
           return num1 * num2;                            
      } else if (operand === 'subtract'){        // if (... 
           return num1 - num2;
      } else {
           console.log("Not a valid operand");
      };
 };
</code></pre>

<p>I am a beginner in Javascript looking to learn and maintain good coding habits. I understand the function above would run regardless of my inconsistent spacing, but is there a correct way of spacing Javascript control loops? </p>

<p>Any advice or coding examples will help! Thanks! </p>
