Task

Take a combined set of elements and apply a function to each element.




( ( callbackFunction1
  =   location value
    .   !arg:(?location,?value)
      & out$(str$(array[ !location "] = " !!value))
  )
& ( callbackFunction2
  =   location value
    .   !arg:(?location,?value)
      & !!value^2:?!value
  )
& ( mapar
  =   arr len callback i
    .   !arg:(?arr,?len,?callback)
      & 0:?i
      &   whl
        ' ( !i:<!len
          & !callback$(!i,!i$!arr)
          & 1+!i:?i
          )
  )
& tbl$(array,4)
& 1:?(0$array)
& 2:?(1$array)
& 3:?(2$array)
& 4:?(3$array)
& mapar$(array,4,callbackFunction1)
& mapar$(array,4,callbackFunction2)
& mapar$(array,4,callbackFunction1)
);