code: function getMultiElementValue(elements) {
    const types = uniq(elements.map(element => element.type))
    if (types.length !== 1) {
      throw new Error(
        'Multiple form elements with the same name must be of the same type',
      )
    }
    switch (types[0]) {
      case 'radio': {
        const theChosenOne = elements.find(radio => radio.checked)
        return theChosenOne ? theChosenOne.value : undefined
      }
      case 'checkbox':
        return elements
          .filter(checkbox => checkbox.checked)
          .map(checkbox => checkbox.value)
      default:
        // NOTE: Not even sure this is a valid use case, but just in case...
        return elements.map(element => element.value)
    }
  }
docs: Returns the combined value of several elements that have the same name e.g. radio buttons or groups of checkboxes