Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
Comparing values to other values or variables - javascript

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.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

  1. There's no operator called and. It should be &&.

  2. There's no variable called windows. It should be window, or simply alert(a).

  3. Declare your variables properly.

  4. 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('⛅');
}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda