9 line JavaScript solution
function lengthOfLongestSubstring(s) {\n        const map = {};\n        var left = 0;\n        \n        return s.split('').reduce((max, v, i) => {\n          
    function lengthOfLongestSubstring(s) {\n        const map = {};\n        var left = 0;\n        \n        return s.split('').reduce((max, v, i) => {\n            left = map[v] >= left ? map[v] + 1 : left;\n            map[v] = i;\n            return Math.max(max, i - left + 1);\n        }, 0);\n    }
['JavaScript']