Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get data from array object in javascript

I am trying to get data from an object. I have tried to get the data as a.doc._id as given below.

function ab(data){alert("content is "+data.doc.id);}

enter image description here

like image 334
ess Avatar asked Feb 11 '26 19:02

ess


1 Answers

You probably need to access the property using the square bracket notation. Try -

alert("sdf" + data["doc._id"]);
like image 102
MD Sayem Ahmed Avatar answered Feb 13 '26 08:02

MD Sayem Ahmed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!