Hello Zhang,
did you check the tutorial of the developer guide already? There is one example for a modification exit with XSJS (Tutorial: Creating a Modification Exit with XS JavaScript - SAP HANA Developer Guide for SAP HANA Studio - SAP Library).
In general the XS JavaScript function has a single parameter with properties for the connection used by the OData request, the name of the temporary table which contains the data before the operation and the name of the temporary table which contains the data after the operation. To get the data you just have to query the data from the relevant temporary table. Consider that the temporary tables existing depending on the operation. But all of that is described in the linked page.
Regarding your coding from your post. In the OData service definition you say that for the exit a function "UpdateHeader" has to be called from the XSJSLIB file. But you named it in the file "updateheaderdata". So have to sync the names. Your function should also have a parameter (e.g. param) by which you can access the described properties.
Best Regards,
Florian