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

139
Views
How to make query parameter values case-insensitive

I want an endpoint that is a GET method to /book with a query parameter called name. If the name is 'scott', I want to return "Cracking the Coding Interview," but if it's 'SCOTT,' I want to do the same thing. Why does this not work?

app.get('/book', function (req, res) {
  let result = ''
  const name = req.query.name.toString().toLowerCase()
  if (name === "scott") {
    result = "Cracking the Coding Interview"
  } else if (name === "enoch") {
    result = "The Pragmatic Programmer"
  } else {
    result = "Good Old Neon"
  }
  res.send(result);
});
about 4 years ago · Juan Pablo Isaza
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!