Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter function

# filter function
l1=[10,20,30,40,50,60,70,80]
l2= [i for i in filter(lambda x:x>30,l1)]
print(l2)


# [40, 50, 60, 70, 80]
# filter takes a function and a collection. It returns a collection of every item for which the function returned True.
Source by elzero.org #
 
PREVIOUS NEXT
Tagged: #filter #function
ADD COMMENT
Topic
Name
1+6 =