Created
December 5, 2021 22:50
-
-
Save bush/4ea13a0bbe3545c1fdfce3570ca39301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.diff = function(arr2) { return this.filter(x => !arr2. includes(x)); } | |
let arr1 = ['release','layer-1','bsp-1'] | |
console.log(`OG list: ${arr1}`); | |
let arr2 = ['release','layer-2','bsp-1'] | |
console.log(`New list: ${arr2}`); | |
console.log(`Remove list: ${arr1.diff(arr2)}`); | |
let newDl = arr2.diff(arr1); | |
console.log(`New downlowd list: ${newDl}`); | |
console.log(`Refresh list: ${arr2.diff(newDl)}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment