title: In JavaScript What's the difference between variable having value and passing that value directly
body: <p>I'm new to development, just need to know in terms of memory does it matter using a value without assigning in to a variable</p>
  <p><strong>Example 1:</strong></p>
  <pre><code>var sendResponse = {
      &quot;a&quot;: 1,
      &quot;b&quot;: 2
  };
  res.send(sendResponse);
  
  OR
  
  res.send({
      &quot;a&quot;: 1,
      &quot;b&quot;: 2
  });
  </code></pre>
  <p><strong>Example 2:</strong></p>
  <pre><code>var valueOne = &quot;hi&quot;;
  var valueTwo = &quot;hithere&quot;;
  
      if (someVariable  == valueOne  || someVariable == valueTwo) {
          //
      }
  
      OR
  
      if (someVariable  == &quot;hithere&quot; || someVariable == &quot;hi&quot;) {
          //
      }
  </code></pre>
  <p><strong>Example 3:</strong></p>
  <pre><code>var concatOne = &quot;hi&quot;;
      var concatTwo = &quot;hithere&quot;;
  
      var concatString = concatOne + concatTwo;
  
      OR
  
      var concatString = &quot;hi&quot; + &quot;hithere&quot;;
  </code></pre>