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

203
Views
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
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!