Simple JavaScript solution with comments
function minWindow(s, t) {\n        var ans = '';\n        \n        // 1. process hashmap\n        var map = {};\n        t.split('').forEach(ch => map[ch] = (
    function minWindow(s, t) {\n        var ans = '';\n        \n        // 1. process hashmap\n        var map = {};\n        t.split('').forEach(ch => map[ch] = (map[ch] || 0) + 1);\n        var count = Object.keys(map).length;\n        \n        // 2. traverse s to find boundaries\n        // both l & r are inclusive\n        var l = 0;\n        var r = -1;\n        \n        while (r < s.length) {\n            if (count === 0) {\n                // good condition\n                // l~r contains t\n                \n                // update ans\n                if (!ans || r - l + 1 < ans.length) {\n                    ans = s.slice(l, r + 1);\n                }\n                \n                // get rid of curr ch and then move l\n                if (map[s[l]] !== undefined) {\n                    map[s[l]]++;\n                }\n                if (map[s[l]] > 0) {\n                    count++;\n                }\n                l++;\n                \n            } else {\n                // bad condition\n                // l~r doesn't contain t\n                \n                // move r and add new ch\n                r++;\n                if (map[s[r]] !== undefined) {\n                    map[s[r]]--;\n                }\n                if (map[s[r]] === 0) {\n                    count--;\n                }\n            }\n        }\n        return ans;\n    }
[]