Closed Chriscbr closed 4 weeks ago
Hey Chris, can I take this issue?
@Pushkarm029, you are welcome to pick up this issue.
I am not sure it makes sense to offer Array.clear()
, but it does make sense to offer clear()
methods on other collection types, so I revised the title and description a little.
@eladb, I double-checked, and the clear() methods are already implemented for MutSet
and MutMap
. It looks like only MutArray
is missing, so I'll go ahead and add it. Let me know if I missed anything or if you have other thoughts!
https://github.com/winglang/wing/blob/1fcd84ed1ca8b48c9bfe5a2cf4411cd381768610/packages/%40winglang/sdk/src/std/set.ts#L98-L104
Congrats! :rocket: This was released in Wing 0.85.24.
Use Case
Methods that will clear the contents of collections in-place:
Proposed Solution
MutArray.clear()
MutMap.clear()
MutSet.clear()
Implementation Notes
No response
Component
SDK
Community Notes