javascript - How to restructure object to array of objects? -


मेरे पास यह ऑब्जेक्ट है

  var डेटा = {_id: 131233442543, SocialMedia_0__Name_: "facebook ", सोशल मीडिया_डब्लूURL_:" http://facebook.com/test ", सोशल मीडिया_आ_नाम_:" ट्विटर ", सोशलमीडिया_1__URL_:" http://twitter.com/test ", सोशलमीडिया_1398083781749__ नाम:" लिंक किया गया ", सोशलमीडिया_1398083781749__URL_:" http: // linkin .com / test "};   

और मुझे ऑब्जेक्ट को इस तरह से पुनर्गठन करने की आवश्यकता है:

  justSites = [{नाम: "facebook", url: "http: // facebook.com/test "}, {नाम:" ट्विटर ", यूआरएल:" http://twitter.com/test "}, {नाम:" लिंक्डइन ", यूआरएल:" http://linkedin.com/test " }];    

इसे ऐसा करना चाहिए:

  var justSites = [], मी; ({नाम: डेटा [पी], यूआरएल: डेटा ["सोशलमीडिया _" + एम [1] +) [पेज पर] (माई = पी। मैच (/ सोशलमेडिया _ (\ d +) __ नाम / /) "__URL_"]});    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -