text: var list;
  var input;
  var mean;
  var median;
  var mode;
  var k;
  // Mean
  function arithmeticMean(array){
      const sumList = array.reduce(
      function (valorAcumulado = 0, nuevoElemento) {
        return valorAcumulado + nuevoElemento;
      }
    );
    const average = sumList / array.length;
    return average;
  }
  // Median
  function medianaCalcule(array){
      array.sort(function(a, b){return a-b});
      const mitadLista = parseInt(array.length/2);
      var mediana;
      if (array.lenght % 2 === 0) {
        const element1 = array[mitadLista - 1];
        const element2 = array[mitadLista];
        mediana = arithmeticMean([element1, element2]);
      } else {
        mediana = array[mitadLista];
      }
      return mediana;
  }
  
  // Mode
  var listCount;
  var listArray;
  function modeCalcule(array){
      listCount = {};
      array.map(
      function (element) {
          if (listCount[element]) {
          listCount[element] += 1;
          } else {
          listCount[element] = 1;
          }
      }
      );
      listArray = Object.entries(listCount).sort(
      function (arr1, arr2) {
          return arr1[1] - arr2[1];
      }
      );
      const mode = listArray[listArray.length - 1][0];
      return mode;
  }
  
  //Printing
  function printingFunction(){
    list = [];
    input = document.getElementsByName('array');
    for (var i = 0; i < input.length; i++) {
      var a = input[i];
      list.push(parseInt(a.value));
    }
    average = arithmeticMean(list);
    median = medianaCalcule(list);
    mode = modeCalcule(list);
    k = "The average is: " + average + "\n";
    k = k + "The median is: " + median + "\n";
    k = k + "The mode is: " + mode + "\n";
    document.getElementById("tendency").innerHTML = k;
  }
  