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

105
Views
How this variable gets value

New to javascript. I reused code from an in-house repository for an in-house tool. I see this function:

function getItemIndex(itemList, item) {
    const isItemPresent = (items) => items[0] === item;
    const itemIndex = itemList.findIndex(isItemPresent);
    return itemIndex;
}

I do not understand how items gets its value.

It is not sent in the function arguments. The entire file does not have any variable with the same name.

Can someone please explain how it works. Or point to the javascript concept related to this so that I can do further reading. Arrow functions said about (parameter) => expression. But this parameter is not defined anywhere from what I see.

about 4 years ago · Juan Pablo Isaza
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!