Skip to content

Commit 812cf83

Browse files
committed
Fix : ****pass values into the function when you call it, not when you define it**** Parameters are NAMES for values, not the values themselve ***
1 parent a2d891a commit 812cf83

File tree

1 file changed

+12
-3
lines changed
  • Sprint-2/1-key-errors

1 file changed

+12
-3
lines changed

Sprint-2/1-key-errors/2.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,25 @@
55

66
// =============> write your prediction of the error here
77

8-
function square(3) {
9-
return num * num;
10-
}
8+
// function square(3) {
9+
// return num * num;
10+
// }
1111

1212
// =============> write the error message here
13+
//SyntaxError: Unexpected number
14+
1315

1416
// =============> explain this error message here
17+
// passing nunber 3 in the function without declarint it as a number to be square
1518

1619
// Finally, correct the code to fix the problem
1720

1821
// =============> write your new code here
1922

23+
function square(num) {
24+
const squareNumber= (num * num);
25+
return squareNumber ;
26+
}
2027

28+
console.log (square(3));
29+
console.log (square(4));

0 commit comments

Comments
 (0)