code: function isMatching(result, expectation) {
    if (result.length !== expectation.length) {
      return false;
    }
  
    // convert results and expectations to strings for easier comparison
    result = result.map(item => item.toString());
    expectation = expectation.map(item => getBox(item).toString());
  
    const reduce_callback = function (previous_result, current_item) {
      return previous_result === true && result.indexOf(current_item) > -1;
    };
  
    return expectation.reduce(reduce_callback, true);
  }
docs: helper function that compares length and values of expectations