How to export array data through node addon
问题 I'm using node 0.12.x, I want to return some array data from node addon written by c++ Isolate* isolate = args.GetIsolate(); MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder()); obj->value_ += 1; args.GetReturnValue().Set(Number::New(isolate, obj->value_)); This is a sample for returning Number data. 回答1: using namespace v8; Create an array: Local<Array> myArray = Array::New(isolate); You can then create objects with properties (or just integers) and push them into the array: for (int