0

I'm new to javascript and trying to understand the purpose/logic of the "?" in a javascript formula.

This is from a calculated field in a PDF form. I've searched javascript resources online and cannot find a definition or context for the logic.

Example:

event.value= this.getField("lebT1").value * (amt >= 250000 ? 250000 : amt) * (1 - this.getField("txtDiscPct").value * 0.01);

Also...

fee += amt < 0 ? 0 : ((amt > 500000 ? 500000 : amt)  * eb2);
Pointy
  • 371,531
  • 55
  • 528
  • 584
Mellenbal
  • 1
  • 1
  • [Ternary (conditional) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) – Pointy Jun 20 '19 at 12:40
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator – Julien Jun 20 '19 at 12:40
  • https://stackoverflow.com/questions/6259982/how-do-you-use-the-conditional-operator-in-javascript – Vadzim Dvorak Jun 20 '19 at 12:41

0 Answers0