title: Javascript nested ternary operator
body: <p>I'm missing something if someone can please explain it to me. I'm trying to re-write existing code into the ternary operator way. 
  I'm getting the following console error :</p>
  
  <p><code>Uncaught SyntaxError: Unexpected token }</code> </p>
  
  <p>which I understand there's a condition not properly formatted which I can't seem to find. So I'm not sure what I'm missing or if I maybe misunderstand something in the filter function? Isn't the ? item.verified === true not suppose to automatically return the objects that's true?</p>
  
  <pre><code>var engagement = "social";
  var audience = [{ 'verified': true, 'name': 'Steve'},
                  { 'verified': false, 'name': 'Phil'},
                  { 'verified': true, 'name': 'Jason'}];
  let data = [];
  
  data = audience.filter((item) =&gt; {
      (engagement === "social") 
      ? item.verified === true
      : (engagement === 'social-crm') 
      ? item.verified === false 
      : (engagement === 'all')
      ? item
  })
  </code></pre>
  
  <p>The syntax that I understand:</p>
  
  <pre><code>data = audience.filter((item) =&gt; {
                if (this.engagement === 'social-crm') {
                  return item.verified === true;
                } else if (this.engagement === 'social') {
                  return item.verified === false;
                } else if (this.engagement === 'all') {
                  return item;
                }
  });
  </code></pre>
  
  <p>Here's the fiddle I've been trying to play around with: 
  <a href="https://jsfiddle.net/phfilly/ya73e325/7/" rel="nofollow noreferrer">https://jsfiddle.net/phfilly/ya73e325/7/</a></p>