JavaScript function signature matching