My JSON is below. It contains two Objects, each with a few key value pairs. How can I search through the entire JSON array and pull the object that contains a particular string as a value?
In this case, I need to pull the object with the coupon_code: COUPON1, so that I can then pull the ID of that Coupon.
In short, I just need to get the id of the Coupon with coupon_code: COUPON1
[Object, Object]
0: Object
coupon_code: "COUPON1"
created_at: "2013-06-04T13:50:20Z"
deal_program_id: 1
id: 7
updated_at: "2013-06-04T13:50:20Z"
__proto__: Object
1: Object
coupon_code: "COUPON3"
created_at: "2013-06-04T15:47:14Z"
deal_program_id: 1
id: 8
updated_at: "2013-06-04T15:47:14Z"
Thanks :)