reverse()
Reverses the list.
Syntax
items.reverse()
Description
Reverses the order of the elements (in place). It doesn't sort, it just reverses.
Example
Loading editor…
Expected output
[3, 2, 1]
When to use?
Bringing the last-added one to the front, iterating in reverse order.