docs: function inferVectorDtype(array, defaultDtype) {
    if (isUndefined(defaultDtype)) {
      defaultDtype = 'object';
    }
    var dtype = null;
  
    // Attempt to infer the dtype
    for (var i = 0; i < array.length; i++) {
      var inferredDtype = inferDtype(array[i]);
      if (inferredDtype !== null) {
        if (dtype === null) {
          dtype = inferredDtype;
        }
        if (dtype !== inferredDtype || inferredDtype === 'object') {
          return newVector(array, 'object');
        }
      }
    }
  
    // Use 'defaultDtype' if all inferences were inconclusive
    var naValue;
    if (dtype === null) {
      dtype = defaultDtype;
      if (dtype !== 'object') {
        naValue = NA_VALUE[dtype];
        for (i = 0; i < array.length; i++) {
          array[i] = naValue;
        }
      }
      return newVector(array, dtype);
    }
  
    // Make sure all values are normalized to the right missing value dtype
    if (dtype !== 'object') {
      naValue = NA_VALUE[dtype];
      for (i = 0; i < array.length; i++) {
        if (isMissing(array[i])) {
          array[i] = naValue;
        }
      }
    }
    return newVector(array, dtype);
  }