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

194
Views
¿Por qué recibo el error "código inalcanzable" cuando intento poner un if en mi función?

Cuando inserto "if (descripciones> = 0.4) {zien ()}, aparece subrayado en rojo con el error "código inalcanzable". ¿Por qué?

 function loadLabeledImages() { const labels = ['Simon', 'Thomas']; return Promise.all( labels.map(async (label) => { const img = await faceapi.fetchImage(`./images/${label}.jpg`); const detections = await faceapi .detectSingleFace(img) .withFaceLandmarks() .withFaceDescriptor(); const descriptions = [detections.descriptor]; return new faceapi.LabeledFaceDescriptors(label, descriptions); if (descriptions >= 0.4){ zien() } }), ); }

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

0

El hecho es que un if es irrelevante. Es un código que aparece después de una declaración de return .

Al ejecutar la función, el motor JS siempre regresará de la función antes de llegar al if . Dado que nunca puede alcanzar el if , el if es inalcanzable.

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!