title: How to check if object contains a string value?
body: <p>I know can read values inside the object as the h tags get populated, but I can't hit the statements checking <code>response.image</code> for a value, even though my console.log shows that it does exist.</p>
  
  <p>I'm not sure whether the below is the correct semantics to check for a value. I presume I might need to do it before the return statement. Hitting <code>response.result.image</code> is fine, but I presume it's because I'm not checking for a string value like the other 2 statements above.</p>
  
  <p><a href="https://i.stack.imgur.com/VKQmn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VKQmn.png" alt="enter image description here"></a></p>
  
  <pre><code>import React from 'react';
  import getResponse from '../Handler/getResponse.jsx';
  import Spinner from '../Spinner/Spinner.jsx';
  
  import './Modal.css';
  
   const Modal = ({close, item}) =&gt; {
      const response = getResponse(item);
      console.log(response);
  
      return (
          &lt;div&gt;
             {response === null &amp;&amp;(&lt;Spinner/&gt;)}
              {response &amp;&amp;(
                  &lt;div className='modal'&gt;
                  &lt;div className='popup'&gt;
                      &lt;h1&gt;{response.result.name}&lt;/h1&gt;
                      &lt;h5&gt;{response.result.description}&lt;/h5&gt;
                      {(response.image === "Error") &amp;&amp;(
                          &lt;p className="text"&gt;{response.result.detailedDescription.articleBody}&lt;/p&gt;
                      )}
                     {response.image &amp;&amp; (response.image !== "Error") &amp;&amp;(
                       &lt;div className="container"&gt;
                                  &lt;div className="left"&gt;{response.result.detailedDescription.articleBody}&lt;/div&gt;
                          &lt;div className="right"&gt;&lt;img className="image" alt="image" src={response.image}/&gt;&lt;/div&gt;
                       &lt;/div&gt;
                     )}
                     {response.result.image &amp;&amp;(
                       &lt;div className="container"&gt;
                          &lt;div className="left"&gt;{response.result.detailedDescription.articleBody}&lt;/div&gt;
                          &lt;div className="right"&gt;&lt;img className="image" alt="image" src={response.result.image.contentUrl}/&gt;&lt;/div&gt;
                       &lt;/div&gt;
                     )}
                     &lt;button onClick={ () =&gt; { close(false) }}&gt;close me&lt;/button&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              )}
          &lt;/div&gt;
     );
  }
  
  export default Modal;
  </code></pre>