Some method
array1.some(callbackfn[, thisArg])
Callbackfn is called on each element in array array1. When the callback function returns true or traversing all arrays, some method terminates. The optional parameter thisArg can replace this object in the callback function.
filter method
array1.filter(callbackfn[, thisArg])
Callbackfn method is called on each element in array1, which returns a new collection of elements that return true in the callback function. The optional parameter thisArg can replace this object in the callback function.
The difference between the two
The some method returns a boolean value, which can be used to check whether there is an object in the array.
The filter method returns a new array that can be used to filter objects in the array
The usage and difference between JavaScript arrays some() and filter() above is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.