Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!