Underscore.js http://underscorejs.org/#object (and lodash.zipObject too)
var arr = ['foo', 'bar', 'baz'];
_.object(arr);
// => {foo: true, bar: true, baz: true}
_.object(arr, 1);
// => {foo: 1, bar: 1, baz: 1}
_.object(arr, _.identity);
// => {foo: 'foo', bar: 'bar', baz: 'baz'}
_.object(arr, function(key) {return key + '!'});
// => {foo: 'foo!', bar: 'bar!', baz: 'baz!'}
Usecase:
// executed once in an initial process
var VALID_VALUES = _.object([
'VALUE_1',
'VALUE_2',
....
'VALUE_1000'
]);
// executed many times
if (input in VALID_VALUES) {
// do some process...
}