Created
May 28, 2016 16:24
-
-
Save aaronshaf/2f866c48088587830e61040cbefdf51c to your computer and use it in GitHub Desktop.
Is there a more terse/blessed way to do this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(new FormData(this.refs.form)).reduce((previousValue, currentValue) => { | |
return Object.assign({}, previousValue, {[currentValue[0]]: currentValue[1]}) | |
}, {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
new Map(new FormData(this.refs.form)))
Not a plain object, but certainly more terse.