Hi Guys,
Please I need your help concerning an issue I am facing.
I have this array
var array = [{"id":150,"post_id":247,"user_id":8,"file_path":"uploads/posts/8/post_fle_dzac1n75xphq_1469965658.jpg","mime":"","type":"image","link":"","public_id":"","created_at":"2016-07-31 11:47:38","updated_at":"2016-07-31 11:47:38"},{"id":164,"post_id":247,"user_id":8,"file_path":"uploads/posts/8/post_fle_rgxyqs4jck6v_1480995716.jpg","mime":"","type":"image","link":"","public_id":"","created_at":"2016-12-06 03:41:57","updated_at":"2016-12-06 03:41:57"},{"id":165,"post_id":247,"user_id":8,"file_path":"uploads/posts/8/post_fle_m3na1v4bcrgp_1480995742.jpg","mime":"","type":"image","link":"","public_id":"","created_at":"2016-12-06 03:42:22","updated_at":"2016-12-06 03:42:22"}]
And I want to return the index of an object in it
var arrObject = {"id":165,"post_id":247,"user_id":8,"file_path":"uploads/posts/8/post_fle_m3na1v4bcrgp_1480995742.jpg","mime":"","type":"image","link":"","public_id":"","created_at":"2016-12-06 03:42:22","updated_at":"2016-12-06 03:42:22"}
I have tried
var index = array.indexOf(arrObject);
But it returns -1. Your help will be so appreciated.
Thanks