Educative

Wouldn't this be a simpler solution to understand

const non_repeat_substring = function (str) {
  let start = 0;
  let end = 0;
  let max = 0;
  let map = {};
  for (let end = 0; end < str.length; end++) {
    const ch = str[end];
    if (map[ch] !== undefined && map[ch] >= start) {
      start = map[ch] + 1      
    }
    map[ch] = end;
    max = Math.max(max, end - start + 1);
  }
  return max;
};

Looks great!