Tuple & Record 提案被废弃,取而代之的是 Composite 提案:
https://github.com/tc39/proposal-composites/
我们在此先不讨论 Composite 好用与否,但我们注意到该提案对 Array.prototype.indexOf 与 Array.prototype.lastIndexOf 的一个改动:
即,如果参数是 Composite,将采用 SameValueZero 语义而非 IsStrictEqual。(其它类型的值仍采用 IsStrictEqual 语义)这无疑会使得 indexOf 与 lastIndexOf 变复杂,同时导致一致性变差。
https://github.com/tc39/proposal-composites/
我们在此先不讨论 Composite 好用与否,但我们注意到该提案对 Array.prototype.indexOf 与 Array.prototype.lastIndexOf 的一个改动:
即,如果参数是 Composite,将采用 SameValueZero 语义而非 IsStrictEqual。(其它类型的值仍采用 IsStrictEqual 语义)这无疑会使得 indexOf 与 lastIndexOf 变复杂,同时导致一致性变差。