let number1 = prompt("Enter first number: "); let number2 = prompt("Enter Second number: "); if (number1 > number2){ console.log(`${number1} is greater than ${number2}`) } else if (number1 < number2) { console.log(`${number1} is smaller than ${number2}`) } else { console.log("Incorrect number") }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter