Skip to content

mathieuprog/find-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-value

Similar to Array.find(), but returns the value of the function invocation instead of the element itself.

import findValue from '@mathieuprog/find-value';

findValue([1, 2, 3], (n) => n > 2 && n * 2) // 6
findValue([1, 2, 3], (n) => n > 3 && n * 2) // undefined

Install

You can get @mathieuprog/find-value via npm.

npm i @mathieuprog/find-value

About

Similar to Array.find(), but returns the value of the function invocation instead of the element itself

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published