News for hackers. Stuff that matters.
Re:A game whose source code fits in one tweet by ivanca on Tuesday June 30, 2015 @02:48AM (#9803385)
He can save 14 more if instead of creating a function he copies the function content inside of 'onclick'. And he can save one by using +new Date instead of Date.now().
Re:A game whose source code fits in one tweet by sgibat on Tuesday June 30, 2015 @06:58AM (#9804260)
Better yet, set a variable to Date.now since it's called twice.
Re:A game whose source code fits in one tweet by ajanuary on Tuesday June 30, 2015 @09:26AM (#9804988)
It's called at different times so will return different values, which is important.
Re:A game whose source code fits in one tweet by ahoge on Tuesday June 30, 2015 @12:36PM (#9806502)
They meant something like "var n = Date.now".

However, there is no guarantee that this will work since it assumes that `this` isn't used by that function.

E.g. if you want to do something like that with console.log or document.querySelector, you have to use bind:

  var log = console.log.bind(console);
  var qs = document.querySelector.bind(document);
Re:A game whose source code fits in one tweet by roberto on Tuesday June 30, 2015 @01:21PM (#9806898)
a = Date.now; b = a(); c = a();