Typically, the map () method is used to get a new array from each return value. In your case, I recommend using forEach ().
var list = ['a','b','c']; var hashObject = {}; list.forEach( function( key ) { hashObject[ key ] = 'blah'; });
Or use the underscore.js library object ()
var list = ['a','b','c']; var hashObject = _.object( list );
Then again, Array.prototype.map is used only to get a new "array", not an "object".
source share