Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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 Respuestas
Responde la pregunta

0

.toLowerCase() is case sensitive.

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda