Here's how you can use the xor
function from the Lodash library in TypeScript:
19 chars2 lines
xor
function from the Lodash library in your TypeScript file:index.ts30 chars2 lines
xor
function with two arrays as arguments:index.ts131 chars5 lines
The xor
function returns an array that contains the unique values that are NOT present in both of the input arrays. In the example above, [1, 2, 5, 6]
is the result of the XOR operation between [1, 2, 3, 4]
and [3, 4, 5, 6]
.
gistlibby LogSnag