var data = ['http://placehold.it/50x50', 'http://placehold.it/100x100']; var obj = {}; for (var i = 0; i < data.length; i++) { obj[i] = data[i]; } console.log(obj);