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

113
Views
How am I supposed to check if the cells of the array are equal?

We need to be able to test if two cells are the same. Complete the function named same that accepts two cells and returns a Boolean indicating if the two cells are the same.

function same([x, y],[j, k]) {
a = same.this [x,y],[j,k];
a.forEach(function(sem){
console.log(sem());
})
 } 

Error Message: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try this, you can change the 3 equal signs (===) to 2(==). In case of comparing string and integer values like 2 and "2".

function same([x, y],[j, k]) {
  if(x===j && y===k){
    console.log(true);
  }
  else{
    console.log(false);
  }
}
same(["a","b"],["c","b"])
same(["a","b"],["a","b"])

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!