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

153
Views
Comencé a aprender JS hace poco tiempo, recibo este SyntaxError: palabra clave inesperada 'else'

Para empezar, soy muy consciente de que ha habido muchas preguntas similares, créanme, no me habría esforzado en crear una cuenta si no las hubiera revisado primero. He estado programando en Python durante unos 3 años, así que no soy ajeno a la lógica de programación, aquí está el código:

 digest (FoodItem) { uk = upkeep(); x = this.fullness + FoodItem.filling; y = this.Capacity + FoodItem.filling * 0.5; if (x>y) { return "Can't eat this" }; else { this.fullness = x; z = 1; if (this.fullness > this.Saturation) { z = 1 + (this.fullness - this.Saturation)*0.1; z = z.toFixed(1); }; if (this.quota < uk) { this.quota = this.quota + FoodItem.mass * z; }; else { ...; }; }; };

Ahora, sé que eliminar el segundo más no resuelve el problema, por lo que creo que el problema principal radica en el primero, pero no tengo idea de por qué no funciona.

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!