I have a list and I pick elements from the list using .pop(). However, I don't want the list to be exhaustive i.e. I want the original list to remain unchanged but want to pick an element from the list using .pop() or .shift()
var list = [1,2,3,4]
list.pop()
Is there any way to do that? Thank you!