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

200
Views
Me cuesta entender por qué esto devuelve x no es una función

Me cuesta entender por qué esto regresa "5Style no es una función"

 NationalLevelCategoriesChosenList = [ ["5Style", "5MelodyHarmony", "5RhythmTempo", "5TextureStructureForm", "5Timbre"] ], [ [] ]; if (NationalLevelCategoriesChosenList[0].some("5Style")) { console.log("working") }

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

0

La función some() le permite probar un valor con una función proporcionada . Creo que quieres usar includes() en su lugar. Por favor, vea el fragmento a continuación.

 NationalLevelCategoriesChosenList = [ ["5Style", "5MelodyHarmony", "5RhythmTempo", "5TextureStructureForm", "5Timbre"] ], [ [] ]; if (NationalLevelCategoriesChosenList[0].includes('5Style')){ console.log("working") }

about 4 years ago · Juan Pablo Isaza Report

0

Vea la documentación para some :

El método some() prueba si al menos un elemento de la matriz pasa la prueba implementada por la función proporcionada.

El argumento que está pasando "5Style" es una cadena, no una función.

Probablemente estés buscando el método includes :

 NationalLevelCategoriesChosenList[0].includes("5Style")

Pero si quisiera usar some , entonces necesita escribir una función:

 NationalLevelCategoriesChosenList[0].some((current_value) => curent_value === "5Style")
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!