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
var dates = dates_as_int.map(function(dateStr) { return new Date(dateStr).getTime(); });
=>
[1468959781804, 1469029434776, 1469199218634, 1469457574527]
Update: ES6 version:
const dates = dates_as_int.map(date => new Date(date).getTime())