diff
Create an array of differences between two arrays
209 bytes
Usage
Given two arrays, returns an array of all items that exist in the first array but do not exist in the second array.
import * as import _
_ from 'radashi'
const const oldWorldGods: string[]
oldWorldGods = ['ra', 'zeus']const const newWorldGods: string[]
newWorldGods = ['vishnu', 'zeus']
const const diff: string[]
diff = import _
_.diff<string>(root: readonly string[], other: readonly string[], identity?: ((item: string) => string | number | symbol) | undefined): string[]export diff
Returns all items from the first list that do not exist in the
second list.
diff(const oldWorldGods: string[]
oldWorldGods, const newWorldGods: string[]
newWorldGods) // => ['ra']