try with Array#Reduce
const arr = ['a','b','c'];
const res = arr.reduce((acc,curr)=> (acc[curr]='',acc),{});
console.log(res)
More Related Contents:
- this in chained jquery functions
- Javascript function only alert Me [closed]
- Turn if-else-if statement into switch statement in Javascript
- How to “properly” create a custom object in JavaScript?
- How to check file MIME type with javascript before upload?
- How can I add or update a query string parameter?
- Change the selected value of a drop-down list with jQuery
- Browser detection versus feature detection
- Regex to match all instances not inside quotes
- Recursion in Angular directives
- Scaling d3 v4 map to fit SVG (or at all)
- Getting BLOB data from XHR request
- JavaScript private methods
- How to convert JSON to CSV format and store in a variable
- Replace multiple characters in one replace call
- Set window to fullscreen (REAL fullscreen; F11 functionality) by javascript
- How to send a message to a particular client with socket.io
- Detecting when user scrolls to bottom of div with React js
- How to inject HTML into a template with polymer
- What is viewport in HTML.
- cloning javascript event object
- Check if file has changed using HTML5 File API
- How to get an Array with jQuery, multiple with the same name
- nodemon command is not recognized in terminal for node js server
- Pros/cons of using redux-saga with ES6 generators vs redux-thunk with ES2017 async/await
- Keylistener in Javascript
- Replace keys in template string with object properties
- Display Good-looking Math Formula in Android
- Rails 5/6: How to include JS functions with webpacker?
- How do I detect IE 8 with jQuery?