Directly define base formulas in JavaScript

Looking through the forum and the developer docs, I can’t tell that there is a way to do this, but it would be very helpful to be able to access and define formulas directly in JavaScript. As it stands, it is rather difficult for me to debug my longer formulas, mainly because of their format. In particular:

  • I can’t define variables to avoid reusing the same value over and over again
  • In order to reuse syntax, I have to copy it over, which makes things difficult if I have to refactor later
  • Whitespace cannot be used to make my formulas more readable
  • The documentation for formulas is (understandably) not nearly as well developed as it is for JavaScript

All of this could potentially be resolved if there was some exposed class for formulas.