TIL find() vs filter()
POSTED ON:
TAGS: javascript arrays
find()
method return the first value which match from the collection. find()
method search the array from the start if the desired value is matched then find()
method return that value and terminate and rest of the array is not process.
filter()
method returns the match value from the array. it search whole array from start to end and returns all the value which is matched.
See the Pen find() vs filter() by rockykev (@rockykev) on CodePen.
REFERENCE:
filter()
method returns the match value from the array.
Related TILs
Tagged: javascript