Week 7 - Wednesday, June 2nd
Review Exercises
// declare the function and its input parameters
function max(num1, num2) {
}function max(num1, num2) {
// function needs to return the max number
// requires a comparison
// (num1>num2)
// if num1 > num2 then num1 is max number
// else num2 is max number
//
// translate these steps into javascript code
if (num1 >num2) return true;
else return false;
// or, a more concise version
return (num1>num2);
}Review Git
Git Bash
Last updated