调用对象函数 - python

时间:2016-09-22 07:20:25

标签: python object

在下面的代码中,内部最后两行之间是否有任何区别?或者只是另一个的缩写?

function extractItems(source) {
  const items = [];

  for (const section of source.sections) {
    for (const rubric of section.rubrics) {
      items.push(...rubric.items);
    }
  }

  items.sort((a, b) => a.name.localeCompare(b.name));

  return { items };
}

0 个答案:

没有答案