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

186
Views
TypeError: response.hits[i].hit_set_id.toLowercase is not a function

I get that error on the console whenever I run this code:

const response = JSON.parse(`{"version":1,"tests":[],"hits":[{"title":"Answer one of our market research surveys (~ 2 to 12 minutes + 1-2 minutes for demographics)","hit_set_id":"36R3RQSDQUGLBEZ545II11576K307C","requester_name":"UXreviewer.io ResearchLab","requester_id":"A1HXBVQANVSV6H","reward":"0.26","description":"Give us your opinion about usability, products, and marketing. The survey itself will be about ~ 2 to 12 minutes; in addition, 1-2 minutes for demographics are required beforehand.","duration_in_seconds":3600,"qualifications":{"project_requirements":[{"qualification_type_id":"00000000000000000071","comparator":"In","worker_action":"AcceptHit","qualification_values":["AL","AM","AN","AQ","AR","AT","AU","BE","BG","BY","CU","CZ","DE","DK","ES","ET","FR","GE","GF","IL","IT","JP","NL","NO","NP","PF","PL","PT","TF","US"],"caller_meets_requirement":true,"qualification_type":{"qualification_type_id":"00000000000000000071","name":"Location","visibility":true,"description":"The Location Qualification represents the location you specified with your mailing address.  Some HITs may only be available to residents of particular countries, states, provinces or cities.","has_test":false,"is_requestable":false,"keywords":"location"},"caller_qualification_value":{"integer_value":null,"locale_value":{"country":"US","subdivision":"IL"}}}]},"last_seen":1635091621,"requester_hourly":null}]}
`);

for (let i = 0; i < response.hits.length; i++) {
      console.log(response.hits[i]);
      console.log(response.hits[i].hit_set_id);
      const hitId = response.hits[i].hit_set_id.toLowercase();
      const title = response.hits[i].title.toLowercase();
      const requesterName = response.hits[i].requester_name.toLowercase();
      const requesterId = response.hits[i].requester_id.toLowercase();
}

As you can tell from the response object, response.hits[i].hit_set_id is a string, yet when I try to call toLowerCase() on it I get that exception. I honestly have no idea what's happening.

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

0

.toLowerCase() is case sensitive.

about 4 years ago · Juan Pablo Isaza Report

0

you spelled toLowerCase wrong in multiple places.

for (let i = 0; i < response.hits.length; i++) {
      console.log(response.hits[i]);
      console.log(response.hits[i].hit_set_id);
      const hitId = response.hits[i].hit_set_id.toLowerCase();
      const title = response.hits[i].title.toLowerCase();
      const requesterName = response.hits[i].requester_name.toLowerCase();
      const requesterId = response.hits[i].requester_id.toLowerCase();
}
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!