%dw 2.0
import * from dw::core::Arrays
output application/json
var arr = [0,1,2,4,3]
---
arr filter $ <= 2
and
%dw 2.0
import * from dw::core::Arrays
output application/json
var arr = [0,1,2,4,3]
---
arr takeWhile $ <= 2
They both give the same results. Is there any difference?