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

128
Views
Filter multidimensional array based on another array

I am new to JS. I have multidimensional array.

var myList = [{"Fund":"Edelweiss1","Rank":10},{"Fund":"Edelweiss","Rank":5}, {"Fund":"Edelweiss3","Rank":3}]

I want to filter "Rank" based on another array.

var rngarray = [6,10];

Filtering on rank should be >=6 and <=10

I tried this - myList.filter(function (v) {rngarray.includes(v["Rank"])}) but does not work.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use Array.prototype.filter():

var myList = [{"Fund":"Edelweiss1","Rank":10},{"Fund":"Edelweiss","Rank":5}, {"Fund":"Edelweiss3","Rank":3}];

var rngarray = [6,10];

var filtered = myList.filter(item => item.Rank >= rngarray[0] && item.Rank <= rngarray[1]);
console.log(filtered);

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!