【问题标题】:Find all employees in the array have been with company exactly or longer than 10 years and are still active in the company returns of loyal employees发现数组中的所有员工都在公司工作了 10 年或超过 10 年,并且仍然活跃在忠诚员工的公司回报中
【发布时间】: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


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-23
  • 1970-01-01
  • 1970-01-01
  • 2010-10-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多