How do I find a particular value in an array?
newdata
(2) [{…}, {…}]
0: {city: ‘mytown’, photo: ‘data:image/png;base64,iVBORw0AAJoA…FLhAXTkSuQmCC’, state: ‘YO’, suite: ‘Penthouse suite’, zip_code: ‘54321’, …}
1: {city: ‘yourtown’, state: ‘MO’, zip_code: ‘12345’, last_name: ‘Dtest2’, cell_phone: ‘4082789949’, …}length: 2[[Prototype]]: Array(0)
newdata.indexOf(“12345”)
-1
newdata.includes(“12345”)
false
baffled: looking for the index that holds a value – do I need to index through all the keys individually?
Bruce Merritt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1