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

133
Views
How to display values from an array of objects within a given range with RamdaJS

I am trying to create a function to filter an array of objects. I need to display all numbers between 2 numbers that I put in my search. I would like to use Ramda. Does anyone have any suggestions?

For example: I have following array of objects:

[{num: 120},{num: 110},{num: 115},{num: 5},{num: 35}]

I would like to display all numbers between 99 and 119. How can I do that with RamdaJS?

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

0

.filter is the function for this. For example:

const inputArray = [{num: 120},{num: 110},{num: 115},{num: 5},{num: 35}];
const min = 99;
const max = 119;
const outputArray = R.filter(val => val >= min && val <= max, inputArray);

If you're trying to have a factory for creating filter functions with different min and max values, that would look something like:

function makeFilter(min, max) {
  return R.filter(val => val >= min && val <= max);
}

// used like:
const filter = makeFilter(99, 119);
const outputArray = filter(inputArray);
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!