del Operator
Last updated
Was this helpful?
Last updated
Was this helpful?
In python, del list[0]
will delete the first item in the list, and truncate it.
The same is not true in Transcrypt. Transcrypt translates del
directly to JavaScript's delete
, so you'll end up with an incoheret list if you use this operator.
Instead, using the pop
operator can work.
If you need to delete a range, the JavaScript method can help: