Test js function