05:08 | <ljharb> | ES2023: https://github.com/tc39/Reflector/issues/466 |
23:03 | <shu> | Michael Ficarra: did you intend step 5 of https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.reduce to be "not present", as in an arguments length check? it is consistent with Array.prototype.reduce, but is generally weirder than just checking for undefined nowadays |
23:06 | <Michael Ficarra> | hmm, yeah it seems like the right call, as that's how we distinguish two pretty radically different behaviors |
23:07 | <Michael Ficarra> | reduce can either be passed the initial memo (which is perfectly reasonable to be undefined ) or it can assume the structure is non-empty and use the first element as the initial memo |
23:07 | <Michael Ficarra> | I think a presence check is the only thing we can do short of separating reduce and reduce1 |
23:07 | <shu> | ah good point, undefined is a good initial value, so the only choice here is an arguments length check |
23:08 | <shu> | thanks |