Girl Develop It Buffalo

JS101 Class 2 Exercises: if and else

Home

Which number is bigger?

  • Write a function named greaterNum that:
    • takes 2 arguments, both numbers.
    • returns whichever number is the greater (higher) number.
  • Call that function 2 times with different number pairs, and log the output to make sure it works (e.g. "The greater number of 5 and 10 is 10.").