Skip to content

ZA-ITP-May-2025 | Christian Mayamba | Module-Structuring and Testing Data | Week 2 #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Mandatory-debug-0 solved
  • Loading branch information
c-mayamba committed Jun 20, 2025
commit 7f2c31a2951b9124e48353d90b4a5eed89b0e6fc
13 changes: 10 additions & 3 deletions Sprint-2/2-mandatory-debug/0.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// Predict and explain first...

// =============> write your prediction here
// =============> The code won't run because the function `multiply`
// is not making any calculation and it is not returning any value.

function multiply(a, b) {
console.log(a * b);
}

console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

// =============> write your explanation here
// =============> The result of multiplying 10 and 32 is undefined because
// has not been properly defined to return a value.

// Finally, correct the code to fix the problem
// =============> write your new code here
// =============> Here's the new code:
function multiply(a, b) {
return a * b;
}

console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);