[JavaScript] 2956. Find Common Elements Between Two Arrays
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n\n---\n\n```\nvar findIntersectionValues = function (a, b) {\n  const seta = new Set(a)\n  const setb = new Set(b)\n  let countAinB = 0\n  for (const e of a) {\n    if (setb.has(e)) countAinB++\n  }\n  let countBinA = 0\n  for (const e of b) {\n    if (seta.has(e)) countBinA++\n  }\n  return [countAinB, countBinA]\n}\n```\n\n---\n
['JavaScript']