# 02 · revealing-module **演示**:揭示模块模式用闭包保存 `items`,只返回白名单方法;返回的 `list()` 是副本,外部改不到内部数组。 **运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开 `http://localhost:8080/examples/18-iife-module-pattern/02-revealing-module/`;开 Console。 **预期控制台输出**: ```text ts,js 2 ``` **类型检查**:`node node_modules/typescript/bin/tsc -p examples/18-iife-module-pattern/02-revealing-module/tsconfig.types.json` **注意**:`list()` 返回 `readonly string[]`,但运行时是普通数组;只读是类型层约束。