You could leverage the filter
and contains
functions and do something like this. Also leaves you with a reusable functin.
%dw 2.0
output application/json
fun any(left: Array, right: Array) =
sizeOf(left filter (right contains $)) > 0
---
["cat", "bat", "mat"] any ["dog", "elephant", "fox", "cat"]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…