JavaScript Solution
\n# Complexity\n- Time complexity:\nO(n+m)\n\n- Space complexity:\nO(n+m)\n\n# Code\n\n/**\n * @param {number[]} nums1\n * @param {number[]} nums2\n * @return {
\n# Complexity\n- Time complexity:\n$$O(n+m)$$\n\n- Space complexity:\n$$O(n+m)$$\n\n# Code\n```\n/**\n * @param {number[]} nums1\n * @param {number[]} nums2\n * @return {number[][]}\n */\nvar findDifference = function(nums1, nums2) {\n    let num1Set = new Set(nums1);\n    let num2Set = new Set(nums2)\n    let result=[[],[]];\n    \n    for(const num of num1Set){\n        if(!(num2Set.has(num))){\n            result[0].push(num)\n        }\n    }\n    for(const num of num2Set){\n        if(!(num1Set.has(num))){\n            result[1].push(num)\n        }\n    }\n    return result;\n}\n```
['JavaScript']