Sha256: fdf97aaebbcad0774dac1eea8b4377a0cec5e8e333285da9d8a75d2c312daa1d

Contents?: true

Size: 438 Bytes

Versions: 2

Compression:

Stored size: 438 Bytes

Contents

//Written using Nila. Visit http://adhithyan15.github.io/nila
(function() {
  var avg, nums, sum;

  Array.prototype.sum = function() {
    var val;
    val = 0;
    for (i = 0, _j = this.length-1; i <= _j; i += 1) {
      val += this[i];
    }
    return val;
  };

  Array.prototype.avg = function() {
    return this.sum()/this.length;
  };

  nums = [1,2,3,4,5];

  console.log(nums.sum());

  console.log(nums.avg());

}).call(this);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nilac-0.0.4.3.9.7.1 shark/test_files/correct_monkey_patch.js
nilac-0.0.4.3.9.7 shark/test_files/correct_monkey_patch.js