I made a program that compares two values of emoticons and then returns another one as input. However, when I enter the correct emoticons, nothing happens. The emoticons look different in code and in real input. windows 10 emoticons.
function output(a) {
windows.alert(a);
}
emoticon1 = window.prompt("enter emoticon:");
emoticon2 = window.prompt("enter emoticon2");
if (emoticon1 === "☀" ) and (emoticon2 === "☁" ); {
output("⛅");
}
Thanks.
There's no operator called and. It should be &&.
There's no variable called windows. It should be window, or simply alert(a).
Declare your variables properly.
Remove that extraneous semi-colon from the if statement.
function output(a) {
alert(a);
}
const emoticon1 = prompt('enter emoticon:');
const emoticon2 = prompt('enter emoticon2');
if (emoticon1 === '☀' && emoticon2 === '☁') {
output('⛅');
}