[removed] How can I transform an array?

前端 未结 6 904
-上瘾入骨i
-上瘾入骨i 2021-01-12 05:10

I have this on a javascript var: (it\'s a http returned data, and I don\'t know if it\'s an array or string - (how can we see that?) - Update: using typeof returned \"string

6条回答
  •  情话喂你
    2021-01-12 05:42

    Assuming your data always looks like that, you can do something like this:

    var foo = [{"nomeDominio":"gggg.fa"},{"nomeDominio":"rarar.fa"}];
    var newarr = [];
    for ( var i=0,j=foo.length;i

    Here's a working fiddle.

提交回复
热议问题