-
-
Notifications
You must be signed in to change notification settings - Fork 337
Expand file tree
/
Copy path2.js
More file actions
26 lines (16 loc) · 727 Bytes
/
2.js
File metadata and controls
26 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Predict and explain first BEFORE you run any code...
// this function should square any number but instead we're going to get an error
// =============> write your prediction of the error here
//The error might be accuring because the parameter can't be a number and should be a variable
// function square(3) {
// return num * num;
// }
// =============> write the error message here
//the Error is a syntax error: Unexpected number
// =============> explain this error message here
// we can put a number or any argument when we call the number not when we shape it
// Finally, correct the code to fix the problem
function square(num) {
return num * num;
}
// =============> write your new code here