0
0
Typescriptprogramming~10 mins

Re-exporting modules in Typescript - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to re-export everything from the module './utils'.

Typescript
export * [1] './utils';
Drag options to blanks, or click blank then click option'
Afrom
Bas
Cwith
Dof
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'as' instead of 'from' causes syntax errors.
Forgetting the keyword 'from' leads to invalid syntax.
2fill in blank
medium

Complete the code to re-export only the named export 'calculate' from './math'.

Typescript
export { [1] } from './math';
Drag options to blanks, or click blank then click option'
Acalculate
Bdefault
Call
Dmath
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'default' when the export is named causes errors.
Trying to export 'all' is not valid syntax.
3fill in blank
hard

Fix the error in the code to re-export the default export from './config'.

Typescript
export { [1] as default } from './config';
Drag options to blanks, or click blank then click option'
AConfig
Bconfig
Cdefault
DdefaultExport
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'config' – that's the module path, not an export identifier.
'defaultExport' refers to a named export if it exists, not the default export.
4fill in blank
hard

Fill both blanks to re-export 'foo' as 'bar' from './module'.

Typescript
export { [1] [2] bar } from './module';
Drag options to blanks, or click blank then click option'
Afoo
Bas
Cfrom
Dexport
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'from' instead of 'as' to rename causes syntax errors.
Swapping the order of 'foo' and 'as' is incorrect.
5fill in blank
hard

Fill all three blanks to re-export 'alpha' and 'beta' from './lib' and rename 'gamma' to 'delta'.

Typescript
export { alpha, beta, [1] [2] [3] } from './lib';
Drag options to blanks, or click blank then click option'
Agamma
Bas
Cdelta
Dexport
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the 'as' keyword causes syntax errors.
Using 'export' inside the braces is invalid.