title: Getting 'undefined' status code in response
body: <p>I am sending response from the node server api side as below:
  1)<code>res.status(200).send({success: true, token: 'JWT ' + token});</code>
  and 2) <code>res.status(401).send({success: false, msg: 'Authentication failed. Wrong password.'});</code>
  When try to get the response back in below react client side function it gives me the json body sent but, it gives me status code as <strong><em>'undefined'</em></strong>:</p>
  
  <pre><code>login(userCredentials) {
      // Get a token from api server using the fetch api
      return this.fetch(`${this.domain}/api/login`, {
          method: 'POST',
          headers: new Headers({'Content-Type':'application/json'}),
          body: JSON.stringify(userCredentials)
      }).then((res) =&gt; {
            console.log('statusCode:'+ res.status)
            console.log('Token:' +res.token)
            this.setToken(res.token) // Setting the token in localStorage
            return Promise.resolve(res);
  
      })
  }
  </code></pre>
  
  <p>Console Output:</p>
  
  <pre><code>statusCode: undefined 
  Token: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjozLCJlbWFpbCI6ImFkbWluQGRyci5jb20iLCJuYW1lIjoiQWRtaW4iLCJwYXNzd29yZCI6IiQyYiQxMCRGY2t3YVNTdG5DVy8xdUZ6Vko3N3VldFM2VFZydmdINVZkYXBnNGZ0RjB5aTFhYWYuZWFZZSIsInJvbGUiOiJBZG1pbiIsImNyZWF0ZWRBdCI6IjIwMTgtMTAtMThUMTM6NDM6MjQuMjUwWiIsInVwZGF0ZWRBdCI6IjIwMTgtMTAtMThUMTM6NDM6MjQuMjUwWiIsImlhdCI6MTUzOTk3NTM3MH0.oGIBXR56gGg1i5npGPgsZkSFxOMup9yY1Sa-D7unikA
  </code></pre>
  
  <p>How can I get both status code and json body in react client from the response sent by node server?</p>