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
The keyword that rounds a number to a specified number of decimal places and converts it to a string is _____. | toFixed | toFixed | |
A number modified by toFixed isn't a number. It's a ______. Answer with 1 word. | string | string | |
Code a statement that rounds num's value to 4 places, and assigns it to strNum, which hasn't been declared beforehand. | let strNum = num.toFixed(4); | letstrNum=num\.toFixed\(4\); | |
Code a statement that rounds num's value to 0 places, and assigns it to strNum, which hasn't been declared beforehand. | let strNum = num.toFixed(); | letstrNum=num\.toFixed\(\); | |
Code a statement that rounds n to 3 places, and assigns it to dec3, which hasn't been declared beforehand. | let dec3 = n.toFixed(3); | letdec3=n\.toFixed\(3\); | |
Code a statement that rounds num to 0 places, and assigns it to intStr, which hasn't been declared beforehand. | let intStr = num.toFixed(); | letintStr=num\.toFixed\(\); | |
Code a statement that rounds a number represented by a variable and assigns it to another variable, which hasn't been declared beforehand. Make up the variable names and the number of decimal places. | let nStr = n.toFixed(2); | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.toFixed\([1-9][0-9]*\); | |
Code a statement that rounds a number represented by a variable to 0 places, and assigns it to the same variable. | num = num.toFixed(); | ([a-z_$][a-zA-Z0-9_$]*)=\1\.toFixed\(\); | |
|
|||
|