Javascript Number downto(f)

Description

Javascript Number downto(f)

Number.prototype.downto = function (f) { for (var i = Number(this); i > 0; --i) f(i); };

10..downto(i => console.log(i));// w  w w.  java2  s .  c  o m



PreviousNext

Related