• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

140
Views
I have a function and I need to know when it will return true and not false

I have this funtion

function riddle (parme) {
  if(parme !== parme) {
    return true;
  }
  return false;
}

when will it return true (I dont know the language)

almost 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is only a single value in JS which is not equal to itself which is NaN. Rest in all cases, it will print false

To check for NaN equality, You should use isNaN

function riddle(parme) {
  if (parme !== parme) {
    return true;
  }
  return false;
}

console.log(riddle(NaN));

almost 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error