简体   繁体   中英

Convert Object into array,angular JS 1.X

I want to convert the below object in an array. object is as like below,

       var obj = {
               "abfdgc" :"def",
               "dfdgsf" : "ret",
               "trytr"  : "dhgf"
       }

into below format :

       var obj = [{
               "abfdgc" :"def",
               "dfdgsf" : "ret",
               "trytr"  : "dhgf"
       }]

在这里,你可以这么简单:

obj = [obj];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM