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

280
Views
este código devolverá verdadero si el elemento existe en la matriz, pero debería ser verdadero cuando el elemento se duplicó

 const arr = [12, 12, 10, 11]; function repeatedItem(i) { if (arr.indexOf(i) !== -1) return true; else return false } console.log(repeatedItem(10));
este código devolverá verdadero si el elemento existe en la matriz, pero debería ser verdadero cuando el elemento se duplicó

qué debe hacer para devolver verdadero si el artículo fue duplicado

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

 const arr = [12, 12, 10, 11]; function repeatedItem(item) { let count = 0; for(let i=0;i<arr.length;i++){ if(arr[i] === item){ count++; if(count > 1){ return true; } } } return false; } console.log(repeatedItem(10));

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!