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
Given the following statement, write a statement that assigns the highest number to the variable big. | let x = 3, y = 2, z = 1; | let big = Math.max(x, y, z); | letbig=Math\.max\(x,y,z\); |
Given the following statement, write a statement that assigns the lowest number to the variable small. | let x = 3, y = 2, z = 1; | let small = Math.min(x, y, z); | letsmall=Math\.min\(x,y,z\); |
Code a statement that finds the sign of the number represented by y and assigns it to x, which hasn't been declared beforehand. | let x = Math.sign(y); | letx=Math\.sign\(y\); | |
Code a statement that finds the square root of 64 and assigns it to x, which hasn't been declared beforehand. | let x = Math.sqrt(64); | letx=Math\.sqrt\(64\); | |
Code a statement that throws away the decimal part of 1.09 and assigns the result to x, which hasn't been declared beforehand. | let x = Math.trunc(1.09); | letx=Math\.trunc\(1\.09\); | |
Code a statement that raises 4 to the third power and assigns the result to x. | let x = Math.pow(4, 3); | letx=Math\.pow\(4,3\); | |
Given the following statement, code an alert that displays the largest number multiplied by 3. | let x = 3, y = 2, z = 1; | alert(Math.max(x, y, z) * 3); | alert\(Math\.max\(x,y,z\)\*3\); |
Given the following statement, code an alert that displays the largest number multiplied by the smallest number. | let x = 3, y = 2, z = 1; | alert(Math.max(x, y, z) * Math.min(x, y, z)); | alert\(Math\.max\(x,y,z\)\*Math\.min\(x,y,z\)\); |
|
|||
|