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

75
Views
Actualización de la pantalla en la calculadora JS

Quiero que mi calculadora muestre "0" cuando se borre o no se hayan ingresado otros números, pero cuando comience a agregar números, quiero que se reemplace el 0. Actualmente, cuando ingreso cualquier número, reemplaza el número en la pantalla por el número ingresado.

 this.currentDisplay = "0" numberData(number) { if (number === "." && this.currentDisplay.includes(".")) return if (this.currentDisplay = "0") { this.currentDisplay = this.currentDisplay.toString().replace("0", number.toString()) } else { this.currentDisplay = this.currentDisplay.toString() + number.toString() } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tiene un error en esta condición:

 if (this.currentDisplay == "0") { ... }

En su código, está asignando this.currentDisplay = 0 , debe comparar con == o mejor === para comparar los tipos de variables también.

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!