functionupdateClock(d){ var time = ''; time += ('0' + d.getHours()).slice(-2); // hhmmss, padded time += ('0' + d.getMinutes()).slice(-2); time += ('0' + d.getSeconds()).slice(-2);
var binary = time .split('') // convert each digit .map(Number) // to a number .map(function(n){ return ('000' + n.toString(2)) // convert it to binary, .slice(-4) // padded, .split(''); // in an array });
binary = transpose(binary);
var text = binary.map(function(line){ return line .join(' ') .replace(/0/g, '○') // utf8 white circle .replace(/1/g, '●'); // utf8 black circle }).join('<br />');