且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将逗号分隔的JSON值显示为列表?

更新时间:2022-05-11 00:17:53

您可以使用

You can use String.prototype.split() to get an array of friends.

var arrayOfFriends = Artist[0].friends.split(", ");
// arrayOfFriends = ['James', 'Harry', 'Bob']

从那里循环遍历数组并创建列表

From there loop over the array and create your list