I have an array like:
let arr = ['ABC', 'DEF']
And I'd like to transform that array to
let obj = {"ABC": 0, "DEF": 0}
What's the appropriate ES6 syntax to make that transformation?
let arr = ['ABC', 'DEF']
arr.reduce(x => ({[x] : 0 }))
This is close but I end up with {"ABC": 0}
Basically, I want to take an array of arbitrary length and assign all of the values in that array to a "default" value of 0.
Thanks!