return uncommon from two arrays js
var array3 = array1.filter(function(obj) { return array2.indexOf(obj) == -1; });let array = [1,2,3,4,5,6,78,9];
function except(array,excluded){
let newArr,temp,temp1;
check1=array.filter(function(value)
{
return excluded.indexOf(value) == -1;
});
check2=excluded.filter(function(value)
{
return array.indexOf(value) == -1;
});
output=check1.concat(check2);
return output;
}
except(array,[1,2])
//so the output would be => [ 3, 4, 5, 6, 78, 9 ]
Also in JavaScript:
- javascript how to split array into subarrays javascript
- add value to array javascript
- javascript remove underscore and capitalize
- load a config file discordjs
- check if js property exists in class
- js code to run hello world
- discord.js v12 how to set owner commands
- Accessing Object Properties with Variables
- shadow using react native
- useeffect with cleanup
- discord.js calculator command
- replace array element javascript stack overflow
- copy to clipboard javascript dom
- big o theory
- jquery ajax promise
- how to send a message using discord.js
- computed setter
- javascript canvas ground zero
- js or operator
- jquery get data attribute
- Material-ui add circle icon
- getrect javascript
- react yup password with number string and uppercase
- javascript cehck if array is empty