added helper function for JSArrays