Computer scienceProgramming languagesJavaScriptBasicsFunctions

Self-invoking functions and closures

Constructing a module pattern

Report a typo

Write down a missing statement to make the following function a Module. (Use the order in which the functions are declared.)

const Calculator = (() => {
    const add = (a, b) => a + b;
    const subtract = (a, b) => a - b;
    const multiply = (a, b) => a * b;
    const divide = (a, b) => a / b;
    /* MISSING STATEMENT */
})()
Enter a short text
___

Create a free account to access the full topic