Lodash | _.xor() Method
The _.xor() method returns an array of the symmetric difference of given arrays i.e. it will create an array that contains an element that doesn’t exist in any other array.
_.xor( arrays )
Parameters: This function accepts one or more parameters as mentioned above and described below:
- arrays: This parameter holds one or more arrays that need to inspect.
Return Value: It returns an array of symmetric difference of given arrays.
const _ = require('lodash') is used to import the lodash library into the file.
[ 3, 2 ]
[ 2, 500 ]
[ 'machine-learning', 'system-app' ]