What does the plus sign do in ‘+new Date’

That’s the + unary operator. It’s equivalent to:

function(){ return Number(new Date); }

See http://xkr.us/articles/javascript/unary-add and MDN.

Leave a Comment