【JS】数组筛选·1

Osinghong6个月前 (04-28)成果展示109
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>d24c04429</title>
</head>
<body>
    <script>
        function salarySelect(salaries) {
            return salaries.filter(salary => salary <= 2000);
        }
        const salaries = [1500, 1200, 2000, 2100, 1800];
        const selectedSalary = salarySelect(salaries);
        console.log(selectedSalary); 
    </script>
</body>
</html>


打赏
分享给朋友:

相关文章

【JS】三元表达式7个月前 (03-17)
【JS】For语句练习7个月前 (03-17)
【JS】关于continue7个月前 (03-24)
【JS】循环嵌套7个月前 (03-24)
【JS】函数的初应用7个月前 (03-31)