This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function( d ) { | |
// Create a copy of this date object | |
var target = new Date(d.valueOf()); | |
// ISO week date weeks start on monday | |
// so correct the day number | |
var dayNr = (d.getDay() + 6) % 7; | |
// Set the target to the thursday of this week so the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// == Enforcing Options =============================================== | |
// | |
// These options tell JSHint to be more strict towards your code. Use | |
// them if you want to allow only a safe subset of JavaScript, very |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function factorialCallback(acc, n, callback) { | |
if (n === 0) { | |
callback(acc); | |
} else { | |
setImmediate(() => factorialCallback(acc * n, n - 1, callback)); | |
} | |
} | |
function timedFactorialCallback(n) { | |
const start = new Date(); |