var timeStamp = new Date().getTime();
However, there is a handy shortcut that gets the same thing:
var timeStamp = +new Date();
It makes me wonder if the
The unary + operator, when used on types other than string, will internally attempt to call valueOf() or toString() (in that order) and then attempt to convert the result to a number. Thusly, the unary + operator can successfully convert many of the native JS types with certain restrictions.