.js file, do the following:
Import or create a script under the Scripts tree folder. This script may reside in the module (that is, it was created using the context menu options "Create Script" or "Import Script", when right-clicking the "Scripts" folder), or can be a reference to a script defined in another module.
For example, to use a function named
var initialAmount = 400000; // initial amount borrowed var intRate = 3.5 / 100 / 12; // monthly interest rate var numMonths = 30 * 12; // number of payments months // calculate mortgage monthly payment var monthlyPayment = getMonthlyPayment(initialAmount, numMonths, intRate);