Skip to content

04 - Array Cardio Day 1 中文答案中05参数错误 #65

@WindChimeEcho

Description

@WindChimeEcho

问题:我在看到04 - Array Cardio Day 1/index-SOYAINE.html文件第105行时,发现此处的people参数并没有passed与year,
而在同一文件夹的index-FINISHED.html文件中,此处people文件的位置显示的是inventors(处于第65行)

比较代码:
index-SOYAINE.html:
// 5. Sort the inventors by years lived、
// 按照他们在世的岁数进行排序
const oldest = people.sort((a, b) => {
const last = a.passed - a.year;
const next = b.passed - b.year;
return (next < last) ? -1 : 1;
});
console.table(oldest);

index-FINISHED.html:
// 5. Sort the inventors by years lived
const oldest = inventors.sort(function(a, b) {
const lastInventor = a.passed - a.year;
const nextInventor = b.passed - b.year;
return lastInventor > nextInventor ? -1 : 1;
});
console.table(oldest);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions