title: Why are there curly brackets in the parameters when declaring this javascript function? (Node, MongoDB in model.js)
body: <p>I'm looking at someone else's functioning Javascript code. Why are there curly brackets in the parameters when declaring a function? eg: </p>
  
  <pre><code>function createUser({username, password, name, weight}, f) {};
  </code></pre>
  
  <p>Is this just enforcing and renaming keys that would be in a passed in object? This is in model.js so perhaps it has something to do with validation?</p>
  
  <p>Follow up questions: How can I get this not to error out when I try to compile this on my machine? I get "SyntaxError: Unexpected token {" at the first of these strange brackets.</p>