i tried to get the length of my Json response but it doesn't work i used "length" with my json result this is what i tried in my class in react js :
componentDidMount() {
axios.get(`http://localhost:51492/api/CommentSurExperience/GetAllCommentOfExperience/${this.props.passedVal}`)
.then(res => {
const persons = res.data;
const longeur = res.length;
this.setState({ persons, longeur });
})
}
then i returned this :
<div> <p> { this.state.longeur}</p> </div>
but i got an empty result .
how can i count how many elements in my JSON response , please thank you for your help.
**********update***********
this is my JSON result using postman

and this is a capture showing what console.log(res) shows

reslooks like?resis a json object and not an array