fork download
  1. Number.prototype.times = function(cb) {
  2. for (let i = 0; i < this; i++) {
  3. cb(i);
  4. }
  5. };
  6.  
  7. (3).times(x => console.log(`Конечно ${x}`));
Success #stdin #stdout 0.02s 16984KB
stdin
Standard input is empty
stdout
Конечно 0
Конечно 1
Конечно 2