Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

diff

v1.0.0arrow_drop_down
v1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
72
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
2 years ago
SIZE
508 B
Computes the difference between two array references.
2 contributors
Use diff in your project ?
Copied
npm i @bit/bit.utils.array.diff
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
revert changes
reload
toggle layout
maximize
diff([1, 2, 3], [1, 2, 3, 4, 5]); // => [4,5]
modifieddraft
chevron_left
chevron_right
diff (
firstArray:[],
secondArray:[]
) : []

Computes the difference between two array references.

Example
diff([1,2,3], [1,2,3,4,5]) // => [4,5]
Arguments
firstArray: []
secondArray: []
Returns
[]

returns an array representing the difference between the two arrays

Test Summary

#array/diff() should return an empty array as both arrays are equal

Pass

#array/diff() should return the difference between the two arrays (1, 5, 6)

Pass