Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
how to filtered higher score in javascript
const students = [
    {
      id: "1",
      name: "Sherlock",
      score:90
    },
    {
      id: "2",
      name: "Genta",
      score: 75
    },
    {
      id: "3",
      name: "Ai",
      score: 80
    },
    {
      id: "4",
      name: "Budi",
      score:85
    }
  ]

and result

{ id: '1', name: 'Sherlock', score: 90 },
{ id: '4', name: 'Budi', score: 85 }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You will need to filter the students by their score first, and then sort them by their score (and name if scores are the same).

const filterStudentsByMinScore = (students, minScore) =>
  students
    .filter(({ score }) => score >= minScore)
    .sort(({ name: na, score: sa }, { name: nb, score: sb }) =>
      sb - sa || na.localeCompare(nb));

const students = [
  { id: "1", name: "Sherlock" , score: 90 },
  { id: "2", name: "Genta"    , score: 75 },
  { id: "3", name: "Ai"       , score: 80 },
  { id: "4", name: "Budi"     , score: 85 },
];

const results = filterStudentsByMinScore(students, 85);

console.log(results);
.as-console-wrapper { top: 0; max-height: 100% !important; }

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!