get current time epoch javascript

JavaScript
var a = Date.now();

// Returns miliseconds since epoch
Source

Also in JavaScript: