Skip to content

Instantly share code, notes, and snippets.

@du5rte
Created May 16, 2017 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save du5rte/81bc669eae8e934245f92a9bd89e4233 to your computer and use it in GitHub Desktop.
Save du5rte/81bc669eae8e934245f92a9bd89e4233 to your computer and use it in GitHub Desktop.
export default function formCollectionToPlainObject(HTMLFormControlsCollection) {
return Object.entries(HTMLFormControlsCollection).reduce((acc, [key, value]) => {
return {
...acc,
[key]: value.value
};
}, {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment