title: Getting Undefined,NaN displayed after correct output is obtained
body: <p><strong>Error</strong></p>
  
  <p><a href="https://i.stack.imgur.com/YKfKJ.png" rel="nofollow noreferrer">Additional Undefined &amp; Nan displayed</a></p>
  
  <p>I have console.log state of the array which stores response value from api, It is giving me expected result, when I am parsing this response and using String, float operation on the parsed data, It is adding additional undefined,NaN %.</p>
  
  <p><strong>Console</strong></p>
  
  <p><a href="https://i.stack.imgur.com/XsHMX.png" rel="nofollow noreferrer">Console of the response state</a></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>import React from 'react';
  import { StyleSheet, Text, View,TextInput } from 'react-native';
  import axios from 'axios';
  
  export default class OutputScreen extends React.Component {
    constructor(props) {
      super(props);
      this.renderCategory = this.renderCategory.bind(this);
      this.state={watdata:[]};
  }
  
    componentWillMount()
    {
      const {state} = this.props.navigation;
  
    axios.post('https://app.accumulate65.hasura-app.io/api2',
    {
       username:'*****',
      type:state.params.inp,
      input:state.params.statement
     })
   .then(response =&gt;this.setState({watdata:Object.values(response.data)})) 
   .catch(error =&gt; {
    console.log(error.response)
  });
  
    }
    renderCategory()
    {
    return this.state.watdata.map((data)=&gt;(&lt;View style={{marginLeft:5}}&gt;
     &lt;Text&gt;{String(data[0].label).substring(String(data[0].label).lastIndexOf("/") + 1, String(data[0].label).length)}                                {parseFloat(String(data[0].score)).toFixed(4)*100} %&lt;/Text&gt;
     &lt;Text&gt;{String(data[1].label).substring(String(data[1].label).lastIndexOf("/") + 1, String(data[1].label).length)}                                {parseFloat(String(data[1].score)).toFixed(4)*100} %&lt;/Text&gt;
     &lt;Text&gt;{String(data[2].label).substring(String(data[2].label).lastIndexOf("/") + 1, String(data[2].label).length)}                                {parseFloat(String(data[2].score)).toFixed(4)*100} %&lt;/Text&gt;
     &lt;/View&gt;));
  
  
    }
  
  
    render() {
      console.log(this.state);
      if(!this.state.watdata){
        return null;
    }
      return (
        &lt;View&gt;
           &lt;Text style={{fontWeight:"bold",marginLeft:5}}&gt;Your Results: &lt;/Text&gt;
          &lt;Text style={{fontWeight:"bold",marginLeft:5}}&gt;Category Name                Confidence&lt;/Text&gt;
          &lt;View&gt;{this.renderCategory()}&lt;/View&gt;
        &lt;/View&gt;
      );
    }
  }
  </code></pre>