a=[ { "user_id":"22b11db4-e907-4f1f-8835-b9daab6e1f23", "object_ids":[ "af86fa9e-65df-47f6-9c35-c3cd17ed8869", "39d159e4-1685-bfb3-3c8a-d82da3169e81" ] }, { "user_id":"39d155ed-da85-7cd5-eda0-1691e2515c6b", "object_ids":[ "af86fa9e-65df-47f6-9c35-c3cd17ed8869", "39d159e4-1685-bfb3-3c8a-d82da3169e81", "39d1512b-0959-ea02-7a83-2d2cece8fe7d" ] } ],b=["39d159e4-1685-bfb3-3c8a-d82abc69e81", "39d159e4-1685-bfb3-3c8a-d82da3169e99"]
大概是這樣的兩個(gè)字符串?dāng)?shù)組,檢測(cè)b內(nèi)元素(不會(huì)有重復(fù)元素)是否在a的object_ids里,每一個(gè)object_ids都要檢查,object_ids內(nèi)沒(méi)有這個(gè)元素則a添加這個(gè)元素,a內(nèi)有b內(nèi)沒(méi)有則a刪除這個(gè)元素,難道要分別循環(huán)a,b?有什么好思路嗎