if (greeting === "Hello" && question === "What's the time?") { console.log("It is 10 'o'clock."); } else if (greeting === "Hello" || question === "What is the weather like tomorrow?") { console.log("It will be sunny tomorrow."); } else { console.log("I don't understand the question."); }
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