Get current timestamp with JS

by Edu Lazaro

JavaScript

const fecha = new Date();
const timestamp = fecha .getTime();
console.log(timestamp);

const timestamp2 = +new Date();
console.log(timestamp2);


const timestamp3 = Date.now();
console.log(timestamp3);