Closed kberg closed 1 year ago
Hello @kberg, I see your point but I am split on this problem as currently I am adhering to the ES6 data structure for consistency reasons and an ES6 Map clear method does not return this, and so currently no clear method from this lib does either.
Well, I see your point.
And, add returns this in the ES6 standard?
And, add returns this in the ES6 standard?
It does indeed: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add#return_value
OK. Well, I hear you. Let's close these, then. Thanks.
// Methods clear(): void; add(key: K, count?: number): this; set(key: K, count: number): this; has(key: K): boolean;
It's currently not possible to write
x.clear().add(...)
, which would be particularly handy.