I’m trying to use array.find() to get the first JSON string that contains amogus
. I’ve tried to read the JSON file using fs then using JSON.parse() to make it readable. However, I can’t seem to get it to do what I want it to do.
JSON file:
{stuff: ["hosds29083", "amogus1208", "amogus1213"]
desired output: amogus1208
Thanks.
3
Answers
Here is a possible solution: