foreach - Why/How does a lodash "[iteratee=_.identity] (Function)" in _foreach have a 'mystery' third param? -


i getting hang of lodash.js first time today , have discovered can access 'value' 'index' , 'list' within iterator function.

i came across when using _.foreach function.

for example:

_.foreach(omyarray, function(value, index, list){     ... }) 

however api specifies 2 params "n" , "key" when dealing objects.

why no mention of third?

? api link has 3 arguments listed right there:

the iteratee bound thisarg , invoked 3 arguments: (value, index|key, collection)


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -