But map does not usually takes two arguments values.customMap((val, index) => 2 * val) It also works on single argument. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map So, I want to understand how are you handling this logic in your code :)