Javascript String toDictionary()

Description

Javascript String toDictionary()

String.prototype.toDictionary = function() {
  return this.split(',').toDictionary();
};

// Shims/*from ww  w.  jav a  2  s  .c o  m*/

if (typeof Object.values === 'undefined') {
  Object.values = obj => Object.keys(obj).map(key => obj[key]);
}



PreviousNext

Related