I have an array of dates and have been using the map function to iterate through it, but I can\'t figure out the JavaScript code for converting them into integers.
This
Using the builtin Date.parse function which accepts input in ISO8601 format and directly returns the desired integer return value:
var dates_as_int = dates.map(Date.parse);