javascript - Cannot access an object property in my array map? -


i'm not able access object's properties array.

here code:

{     this.props.viewer.messagesbyuser.edges.map(edge => {         console.log("chatfriendpoppup id = ", chatfriendpoppup.id)         console.log("receiver['_id'] = ", edge.node.receiver['_id']) // returns undefined         console.log("receiver._id = ", edge.node.receiver._id) // returns undefined         console.log("receiver._id = ", edge.node.receiver)         if (edge.node.receiver._id.tostring() === chatfriendpoppup.id.tostring()) {             return <li > {                 edge.node.body             } - seen: {                 edge.node.seen             } < /li>         }     }) } 

receiver has properties this, cannot ._id

{     _id: 597 f7eb1e5131d5a50e18d14,     updatedat: 2017 - 07 - 31 t19: 02: 09.035 z,     createdat: 2017 - 07 - 31 t19: 02: 09.035 z,     fullname: 'ria atayde',     email: 'myloves@gmail.com', } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -