Home HTML Data Types DOM JavaScript JS Debugging

Hacks

  • Write a JavaScript program that compares two variables, a and b. Log “a is greater” if a is greater than b, “b is greater” if b is greater than a, and “both are equal” if a and b are equal. Make sure to use if statements and console.log

Pre-defined values of a and b

User-inputted values of a and b