shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
sameItems
Type:Function
Status:beta
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.array
This function take two arrays and return all the items that are the same. You can specify if you want only comparing by reference for object, etc… or if you want to transform items in hashes and compare that instead.
Params
- …arrays*-Array
The arrays you want to compare
- settings{}Object
Some settings to refine your comparaison process
Return
- -Array
An array containing all the items that are present in all the passed arrays
Example
import { sameItems } from '@blackbyte/sugar/array';
sameItems([1,2,3,4], [1,3,5]); // => [1,3]Settings
- referencestrueBoolean
Specify if you want to use the references comparaison or not
- hashtrueBoolean
Specify if you want to allows transforming object etc in to hashes and compare this instead
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space