For this Question: How would you add your own method to the Array object so
the following code would work? 
const arr = [1, 2, 3]
console. log(arr.average())
// 2input will be an array, run like this
const anyArray = [5,6...]
anyArray.average should return average of the arraysAverage of the given arrayconst myArray = [1,2,3,4,5]
console.log(myArray.average())
// 3, I have written this Solution Code: Array.prototype.average = function() {
  // calculate sum
  var sum = this.reduce(function(prev, cur) { return prev + cur; });
  // return sum divided by number of elements
  return sum / this.length;
  }
  , In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?