【发布时间】:2022-06-14 23:44:25
【问题描述】:
查找数组中的所有员工都已在公司工作满 10 年或超过 10 年,并且仍然活跃在忠诚员工的公司回报中
const sampleData = [
{
"name": "John Doe",
"yearOfEmployment": 1995,
"isActive": false
},
{
"name": "Marissa Williams",
"yearOfEmployment": 2007,
"isActive": true
},
{
"name": "Isabelle Keanna",
"yearOfEmployment": 2000,
"isActive": true
},
{
"name": "Mark McRolland",
"yearOfEmployment": 2018,
"is ACTIVE": true
}
];
function findLoyalEmployees(employees, currentYear) {
let loyal =[];
return loyal;
}
const year = (new Date()).getFullYear(); // get the current year
`const listOfloyalEmployees = findLoyalEmployees(sampleData, year);
【问题讨论】:
-
到目前为止您尝试了哪些,哪些对您不起作用
标签: javascript arrays