Convert javascript array to string

前端 未结 14 893
逝去的感伤
逝去的感伤 2020-11-29 16:41

I\'m trying to iterate over a \"value\" list and convert it into a string. Here is the code:

var blkstr = $.each(value, function(idx2,val2) {                        


        
14条回答
  •  春和景丽
    2020-11-29 17:29

    Shouldn't confuse Array's with Lists... This is a list: {...} and has no length, or other Array properties.

    This is an Array: [...] and you can use array functions, methods and so, like someone suggested here: someArray.toString();

    "someObj.toString();" just will not work on any other objects type, like Lists. ;-)

提交回复
热议问题