TIL I learned that if you set the `length` property of a javascript array, it will truncate it. So bizarre.
```
a = [1,2,3]
a.length = 0
a === []
I understand that is is used sometimes for performance because it doesn't allocate memory
Please Login to reply.
I understand why you would want it, but a read-only property and a `clear` method would make way more sense. But it's javascript, you can't be too harsh
Yeah way more but I would never ask JavaScript for logic