diff
Create an array of differences between two arrays
209 bytes
since v12.1.0
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 _
_.function diff<string>(root: readonly string[], other: readonly string[], identity?: (item: string) => string | number | symbol): string[]
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']