Javascript Array toDictionary()

Description

Javascript Array toDictionary()


Array.prototype.toDictionary = function() {
  var dict = {};//from w  w w.  j  av  a2 s  .  co  m
  this.forEach(word => dict[word] = true);
  return dict;
};



PreviousNext

Related