title: JavaScript: destructuring with a conditional statement
body: <p>I would like to get <code>firstName</code> and <code>lastName</code> properties from a whole <code>user</code> object. I need to use a conditional statement too.
  How to do something like that?</p>
  
  <p><code>getUserById(id)</code>and <code>getUserByAddress(id)</code> use the JavaScript <code>find()</code> method that returns an element or <code>undefined</code>.</p>
  
  <pre><code>let { firstName, lastName } = getUserById(id);
  if ({ firstName, lastName } === undefined) {
    { firstName, lastName } = getUserByAddress(id);
  }
  return `${firstName} ${lastName}`;
  </code></pre>