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

205
Vistas
JavaScript - Is there a more efficient way to write this function?

I wrote this for a simple calculator form. I left a couple of unused variables in the code due to wanting to pull the user input and function result into a PDF. The exposure variable will also be pulled into the PDF form.

function results (form) {
    let a = parseInt(form.nincome.value);
    let b = parseInt(form.aexpense.value);
    let c = parseInt(form.egrowth.value);
    let d = parseInt(form.eexpense.value);
    let e = parseInt(form.tgsales.value);
    let f = parseInt(form.tpayroll.value);
    let g = parseInt(mpindemnity.value);
    let exposure = a + b * c;
    let limit = exposure / 12 * g + d;
    document.getElementById("est_limit").innerHTML = "Your suggested Business Income and Extra Expense Limit = " + limit;
}
about 4 years ago · Juan Pablo Isaza
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