title: Node JS function parameters defined as object attributes - allowed or not?
body: <p>I've been running Node JS code from the VS Code terminal panel and stumbled across a little bit of syntax sugar where</p>
  
  <pre><code>function foo(input_mapping){
    console.log(
      input_mapping.a,
      input_mapping.b,
      input_mapping.c
    );
  }
  </code></pre>
  
  <p>can be instead declared as </p>
  
  <pre><code>function foo({a,b,c}){
    console.log(a,b,c);
  }
  </code></pre>
  
  <p>where they're both called with something like</p>
  
  <pre><code>foo({
    a:1,
    b:2,
    c:3
  }); // -&gt; '1 2 3'
  </code></pre>
  
  <p>however just recently I tried to run this same code through the terminal and the first { got flagged as a syntax error. What's going on? Why would one terminal take issue but not the other? Which JS interpretation is the correct one?</p>