Skip to content

Commit 82a32ef

Browse files
committed
added prediction and explanation of current code
1 parent baad84d commit 82a32ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// this function should square any number but instead we're going to get an error
55

6-
// =============> write your prediction of the error here
6+
// I think this code will throw an error because we are passing an actual number into the parameters but javascript only allows a variable to be passed into the parameters that can be used to store information so i would need to change the number 3 into num ( and num here would act as the placeholder for any number passed in when the function gets called later) for this code to work because as it is i believe num would be undefined as it hasn't been defined anywhere.
77

88
function square(3) {
99
return num * num;

0 commit comments

Comments
 (0)