Use map and filter in Java script task caused AssertionError

Hello
I have a script task in my process. I use below script to transform some api response But I got the
java.lang.AssertionError: jdk.nashorn.internal.ir.BinaryNode exception. Is there anyway to fix it?

Here is the script:
S(JSON.stringify(JSON.parse(execution.getVariable("response")).result.records.map(i=>i.path)));

Thanks

I use a function reference instead of i=>i.path like below and problem solved:

S(JSON.stringify(JSON.parse(execution.getVariable("response")).result.records.map(myMapFunction)));