(7/10)
Importing Secret Powers (Modules) — JavaScript typing lesson
Import and export code modules for organization.
What you'll practice
JavaScript has secret spellbooks called modules that give you new powers! Let's import a spell from our `magic_spells.js` module.
- `import { cast_spell }` tells JavaScript to bring in the `cast_spell` power.
- `from './modules/magic_spells.js'` tells JavaScript where to find the spellbook.
Pro Access Required
This is a premium lesson. Upgrade to Pro to unlock this interactive exercise and continue your learning journey.
📜JavaScript
Importing Secret Powers (Modules)
0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
import { cast_spell } from './modules/magic_spells.js';↵
↵
cast_spell('fireball');↵
cast_spell('healing');
0 / 103
Press This!
👇
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
⌫
⇥
Q
W
E
R
T
Y
U
O
P
[{
]}
\|
⇪
A
S
D
F
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky