mediumJS ES5#52

Module pattern (IIFE)

Prompt

Create a module using an IIFE that exposes a public API with add and getAll methods. The internal items array must be private, and getAll must return a copy so callers cannot mutate internal state.

Hints

Solution

Your Code

5 min

Tests

Click Run to test your code