Converting string array to Name/Value object in javascript

后端 未结 4 1593
甜味超标
甜味超标 2020-12-11 09:10

I currently am dealing with a Web Service that is returning an array of strings to the client. From here I would like to take this array of strings and convert it into an o

4条回答
  •  情深已故
    2020-12-11 09:59

    I haven't tested this but you can do something like

    $(result).map(function(){return {'value':this}});

提交回复
热议问题