TypeScript

Forgetting to export a namespace member in TypeScript

TypeScriptModules & NamespacesNamespacesintermediate

What this snippet does

Without the 'export' keyword inside a namespace, members are private to the namespace and inaccessible externally.

Expected output

undefined

Why practise typing this

Typing modules & namespaces code builds muscle memory for the symbols and indentation TypeScript uses most, which prose-based typing tests never cover. DevType measures your words per minute and accuracy on this snippet and tracks the individual characters you mistype, so later lessons can target them.

More TypeScript practice

Browse all TypeScript snippets →