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

219
Views
if(1 == 1) if(1 == 'one') if(1 = 1) if(1===1) if(1==='1') which is true and why?
if(1 == 1)

if(1 == 'one')

if(1 = 1) 

if(1===1) 

if(1==='1')

I would like to know which is true and why?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

  1. First condition is true, because a number is always equal to itself.
  2. Second condition is a false statement as "one" does not get converted into number type (type coercion).
  3. Third condition will give error as '=' is an assignment operator and can't be used for comparison.
  4. Fourth condition is again true because a number is compared to itself.
  5. Fifth condition is a false statement, as strict equality ('===') checks for the value as well as the type of operand. First operand is a number but second is string. So it will evaluate to false.
about 4 years ago · Santiago Trujillo 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!