title: ternary operator inside map
body: <p>I'm working on a webapp where the user views a list of items and can mark certain items as favourites. The favourites are provided as an array of ID's with a prop (this.props.favourites). 
  To prevent duplicate entries I want to replace the 'add to favourites' button with a 'delete from favourites' button if the item.id is already in the this.props.favourites array. </p>
  
  <p>However, the ternary If statement I've made crashes on a syntax error. Yet I thought I followed the official example (<a href="https://reactjs.org/docs/conditional-rendering.html" rel="nofollow noreferrer">https://reactjs.org/docs/conditional-rendering.html</a>)  pretty closely. </p>
  
  <p>This is the code that I used: </p>
  
  <pre><code>render() { 
  
         const items = this.state.items.map((item, index) =&gt; (
             &lt;p key={index}&gt;
                 {item.name}
             &lt;/p&gt;
  
             {(this.props.favourites.include(item) ? (
                 &lt;button&gt;add fvourites&lt;/button&gt;
               ) : (
                 &lt;button&gt;delete&lt;/button&gt;
       )}
  
         ));
         return (
             &lt;div&gt;
                 &lt;button onClick={this.LoadApi}&gt;Show fetch Items&lt;/button&gt;
                 &lt;div&gt;{items}&lt;/div&gt;
             &lt;/div&gt;
         );
     }
  }
  </code></pre>
  
  <p>Does anyone have an idea what I am doing wrong?</p>