If you’re using ES6 (or something like Babel/browserify), you can write it like this:
iconMap : {
[KEYS.PHONE_TYPE] : 'icon-phone',
[KEYS.AGENT_TYPE] : 'icon-headphones'
};
More Related Contents:
- Reloading a single div in an html page [closed]
- Auto Uploading file
- How to save an HTML5 Canvas as an image on a server?
- Are Javascript arrays sparse?
- How to initialize an array’s length in JavaScript?
- What is the difference between state and props in React?
- How can I set default homepage in FF and Chrome via javascript?
- Sanitizing user input before adding it to the DOM in Javascript
- When do I use parentheses and when do I not?
- Prevent form submission with enter key
- Android WebView JavaScript from assets
- Server Side Calculation using Firebase
- Download Canvas as PNG in fabric.js giving network Error
- Binding vs Arrow-function (in JavaScript, or for react onClick)
- How to get the start and end points of selection in text area?
- Calculate working days between two dates in Javascript excepts holidays
- How to take screen shot of current webpage using Javascript/JQuery?
- Javascript: best Singleton pattern [duplicate]
- How to open specific tab of bootstrap nav tabs on click of a particuler link using jQuery?
- update textarea value, but keep cursor position
- Save canvas as jpg to desktop [duplicate]
- The collection nested inside firebase collection’s model doesn’t have add function
- JS checking deep object property existence [duplicate]
- Add names of the states to a map in d3.js
- How can I prevent a click on a ‘#’ link from jumping to top of page?
- jquery/javascript: function(e){…. what is e? why is it needed? what does it actually do/accomplish?
- How to create a custom input type?
- Why does preventDefault on checkbox click event returns true for the checked attribute?
- Change/Get check state of CheckBox
- using javascript to mark a link as visited