What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-19 03:07:17
javascript splice without changing array
I assume you mean that you want to create a new list without a given element, instead of changing the original list. One way is to use a list comprehension: m = ['a', 'b', 'c'] n = [x for x in m if x != 'a'] n is now a copy of m, but without the 'a' ele... Add solution