【JS】数组筛选·1

Osinghong8个月前 (04-28)成果展示141
<!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>


打赏
分享给朋友:

相关文章

【H5】简易百度10个月前 (02-24)
【JS】三元表达式9个月前 (03-17)
【JS】3.17课后练习9个月前 (03-17)
【JS】For语句进阶9个月前 (03-24)