1
var longestSubarray = function (nums) {5
// Keep track of the idx where the last zero was seen7
while (r < nums.length) {8
// If we encounter a zero10
// If this is the first zero encountered, then set the zeroIdx to the current r index11
if (zeroIdx === null) zeroIdx = r;13
// If we've already encountered a zero, then set the l index to the zeroIdx + 1,14
// effectively removing that zero from the subarray16
// Then update the zeroIdx to the current r index17
// This way there will be, at most, one zero in the subarray at all times21
longest = Math.max(longest, r - l);