如何获取JavaScript中两个数组之间的差别? - How to get the difference between two arrays in JavaScript?

问题:

Is there a way to return the difference between two arrays in JavaScript? 有没有办法返回JavaScript中两个数组之间的差? 数组

For example: 例如: ide

var a1 = ['a', 'b'];
var a2 = ['a', 'b', 'c', 'd'];

// need ["c", "d"]

解决方案:

参考一: https://stackoom.com/question/4yvW/如何获取JavaScript中两个数组之间的差别
参考二: https://oldbug.net/q/4yvW/How-to-get-the-difference-between-two-arrays-in-JavaScript
相关文章
相关标签/搜索