Call toJSON on arrays