-
-
Notifications
You must be signed in to change notification settings - Fork 337
Expand file tree
/
Copy path2.js
More file actions
22 lines (14 loc) · 517 Bytes
/
2.js
File metadata and controls
22 lines (14 loc) · 517 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Predict and explain first BEFORE you run any code...
// this function should square any number but instead we're going to get an error
// =============> identifier not declared (unknown)
function square(3) {
return num * num;
}
// =============> Unexpected number
// =============> the parameter shouldn't be given an argument in the function definition
// Finally, correct the code to fix the problem
// =============> my new code
function square(num) {
return num * num;
}
console.log(square(3));