# apply(BasicList,BasicList,Function) -- apply a function to pairs of elements, one from each list

## Synopsis

• Function: apply
• Usage:
apply(L1,L2,f)
• Inputs:
• L1, or
• L2, or of the same length as L1
• f, , with two arguments
• Outputs:
• , with the ith element obtained by evaluating f(L1_i,L2_i)

## Description

The result will have the same class as the class of L1 and L2.
 i1 : apply({1,2,3}, {100,200,300}, (i,j) -> i+j) o1 = {101, 202, 303} o1 : List i2 : apply([1,2,3], [100,200,300], (i,j) -> i+j) o2 = [101, 202, 303] o2 : Array i3 : apply((1,2,3), (100,200,300), (i,j) -> i+j) o3 = (101, 202, 303) o3 : Sequence
The exception is that for strings, the result will be a sequence.
 i4 : apply("foo", "bar", concatenate) o4 = (fb, oa, or) o4 : Sequence