text: function reduce(array, callback, initialValue) {
    let prev = array[0];
    let i = 1;
  
    if (initialValue) {
      i = 0;
      prev = initialValue;
    }
  
    for (i; i < array.length; i++) {
      prev = callback(prev, array[i], i, array);
    }
  
    return prev;
  }
  
  module.exports = reduce;
  