updated js-array to stringify condition in filter

This will fix the issue with the condition closure