JavaScript implementation: name anonymous functions