This would be the intended behaviour
a = ['foo', 'bar', 'thing', 'etc'];
b = someFunction(a, false);
b; //{'foo': false, 'bar': false, 'thing': false, 'etc': false}
Is there some function I can use that will take an array and a default value and produce an object with each array element as a key pointing to the default value?
edit: thank you all for the suggestions for writing my own. I was just wondering about a builtin, something like python's default dict.