console.log is printing the value two times once it is printing the empty array and in the other value it is printing the value obtained from the ajax call.

With the value given below it printing like '[]' and ["answered"]

I don't know where it is getting initialised where i am putting a debugger on it it is stopping only once over there just for printing the ajax data value

> 
> {
>  "status": 1,
>  "value": 4,
>  "data": {
>  "answer\_text": "answered"
>  }
>  }
> 
> 
> 

```js
class Discuss extends React.Component {
  constructor() {
    super();
    this.state = {
      discussions: []
    };
  }
  componentWillMount() {
    this._getData();
  }
  _getAnswerText() {
    return this.state.discussions.map(discussion => discussion.answer_text);
  };

  render() {
    const comments = this._getComments();
    return ( <div> {comments} <ActionBar answer_text={this._getAnswerText()}/></div > );
  });
}

_getData() {
  $.ajax({
    method: 'GET',
    url: '/someurl'
    success: (discussions) => {
      var array = [];
      array.push(discussions);
      var dis = []
      dis.push(array[0].data)
      this.setState({
        discussions: dis
      });
    }
  });
}
}

class ActionBar extends React.Component {
    constructor(props) {
      super(props);
    };
    render() {
        console.log(this.props.answer_text)
        return ( <div> {this.props.answer_text} </div>)
 };

}

ReactDOM.render(<Discuss/>,document.getElementById('content'));
```