void MyFunction(const FunctionCallbackInfo& args) { int num_args = args.Length(); // retrieve arguments array length // do something with the arguments... }
void MyFunction(const FunctionCallbackInfoThe package library for V8 FunctionCallbackInfo is likely "v8.h", which is the header file for the V8 engine's C++ API.& args) { if (args.Length() != 2) { // throw an exception if the number of arguments is not 2 return ThrowTypeError("Expected exactly 2 arguments"); } // do something with the arguments... }