📌  相关文章
📜  将对象数组缩减为字符串 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:37.401000             🧑  作者: Mango

代码示例1
var authors = [{
  name: "a"
}, {
  name: "b"
}, {
  name: "c"
}];
var result = authors.reduce(function(author, val, index) {
  var comma = author.length ? ", " : "";
  return author + comma + val.name;
}, '');
console.log(result);