8.2.3 Example: Creating an MLE Module

This example demonstrates the creation of an MLE module.
  1. In the MLE JS page, in the left pane, select Modules from the object type selector and then click Object submenu - Create Object.
  2. In the right pane, select the Editor tab, and enter the following JavaScript function:
    export function factorial(num) {
        if(num < 0) {
            return -1;
        } else if (num == 0) {
            return 1;
        } else {
            return(num * factorial(num-1));
        }
    }
  3. In the Name field, enter factorial_mod.
    Module Code in Editor Tab
  4. Click Save Module.
    A notification that the module is saved in the database is displayed.