Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active December 21, 2021 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/46e70bced8e60bb7e833d570f764a6bc to your computer and use it in GitHub Desktop.
Save McLarenCollege/46e70bced8e60bb7e833d570f764a6bc to your computer and use it in GitHub Desktop.
Exercise : Bigger Of Two Using Ternary

Write a Javascript expression to find the greater of two unequal numbers using the ternary operator.

CODE TEMPLATE


let num1 = 5;
let num2 = 7;
let greater = ;// write your expression here
console.log(greater + "is the greater of "+ num1 + "and " +num2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment