Can array values be transformed into property names for an object in a single line?
For example:
var arr = ['name', 'age', 'size'];
To achieve:
{'name' :null, 'age':null, 'size':null}
Currently, the process involves:
var arr = ['name', 'age', 'size'];
let obj = {};
arr.map(z => obj[z] = null);
This method seems to be the shortest but certainty is in question.