Echo JS 0.11.0

<~>
calois 529 days ago. link 1 point
Not sure about the code below:

(function(){
  var v = Math.ceil(Math.random()*1000);
  for(var i=0;i<5;i++){
	  v = Math.ceil(v/10);
  }
  var t = ['ac','te'];
  console.log(window["Da"+t[v]]["no"+"ow".charAt(1)]());
})();

Replies

photopea 528 days ago. link 1 point
The task was a program, that always prints a timestamp, but your program prints it "almost always" (when random has not returned a zero). I am not sure if it is a solution, but I like it very much! :)

I wonder if there could be a better solution without randomness.