File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 22
33// Why will an error occur when this program runs?
44// =============> write your prediction here
5+ // An error will occur because the variable decimalNumber is being declared as both
6+ // a parameter and as a local variable inside the function. This will cause a
7+ // syntax error. Additionally, the variable decimalNumber is not defined
8+ // outside the function, so it will throw a ReferenceError when trying to log it
9+ // to the console.
510// The percentage sign is not seen as a text character but instead as code for
611// the function to calculate the remainder after a division operation: the modulo.
712// It will therefore not return a percentage as desired
Original file line number Diff line number Diff line change 44// this function should square any number but instead we're going to get an error
55
66// =============> write your prediction of the error here
7- // num has not been defined and the parameter is not used in the function;
7+ // " num" has not been defined and the parameter is not used in the function;
88// it has a number instead
99
1010
You can’t perform that action at this time.
0 commit comments