The problem is as follows: Given two arrays, write a function to compute their intersection.
The below code is my solution.I'm just curious as to what the space time and complexity of below algorithm would be.
var intersection = function(nums1, nums2) {
const intersectionArr = nums1.filter((value)=> nums2.includes(value));
return [...new Set(intersectionArr)];
};