Hi,
I don't know much about JS code but one way of doing that could be to use an enrichment activity. By creating a link to the imported file as a collection, you will be able to retrieve the line (and thus its value) corresponding to the most recent date contained in the column.
If you absolutely want do to it by JS, you can query the temporary table containing the data of the file using an sqlExec command to select the Max date of the column where dates are stored.
Hope this helps,
Florent