code: function deduplicate(array, areEqual) {
          var result;
          if (array) {
              result = [];
              loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
                  var item = array_6[_i];
                  for (var _a = 0, result_1 = result; _a < result_1.length; _a++) {
                      var res = result_1[_a];
                      if (areEqual ? areEqual(res, item) : res === item) {
                          continue loop;
                      }
                  }
                  result.push(item);
              }
          }
          return result;
      }
docs: TODO: fixme (N^2) - add optional comparer so collection can be sorted before deduplication.