RJS: inner functions