del Operator
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 splice
method can help:
Last updated
Was this helpful?