javascript remove duplicate in two arrays
array1 = array1.filter(function(val) {
return array2.indexOf(val) == -1;
});
// Or, with the availability of ES6:
array1 = array1.filter(val => !array2.includes(val));
Also in JavaScript:
- kb to mb js
- discord.js mute script
- canvas fillrect
- code to launch browser using javascript
- jquery script tag
- Ajax send date to MVC
- export app react native
- javascript replace \n
- <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'/>
- sleeping in js
- node js else
- add javascript
- Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
- javascript check for null variables
- js get string byte size
- scroll to top in react
- class javascript
- dart map to json string
- js code to run hello world
- js window redirect
- ajax open new tab with post
- javascript function that make a choice
- js array contains
- convert milliseconds to minutes and seconds javascript