1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
What is the file extension of a module? | .js | \.js | |
Fill in the blank to make the three features available to other scripts and .js files. | ______ { num, showNum, an Animal }; | export | export |
Code the statement that exports two features of a module. Make up the names of the features. | export { name, age }; | export{[a-z_$][a-zA-Z0-9_$]*,[a-z_$][a-zA-Z0-9_$]*}; | |
Rewrite the following code to correct it. | export { computeInterest() }; | export { computeInterest }; | export{computeInterest}; |
A module file contains the following code. Export both features. | const scores = [23, 11, 99]; function sendDate() { return new Date(); } |
export { scores, sendDate }; | export{scores,sendDate}; |
Code the opening tag for a script that imports from a module. | <script type = "module"> | (?<=<)scripttype=•module•> | |
Code the statement that imports two features from a module. The module is at "./mod.js". Make up the names of the features. | import { scores, addScores } from "./mod.js"; | import{[a-z_$][a-zA-Z0-9_$]*,[a-z_$][a-zA-Z0-9_$]*}from•\.\/mod\.js•; | |
Code the opening script tag and the statement to import a single feature. The module is at "./mod.js". Make up the name of the feature. | <script type = "module"> import { scores } from "./mod.js"; |
(?<=<)scripttype=•module•>[\r\n]import{scores}from•\.\/mod\.js•; | |
|
|||
|