Javascript Array toDictionary()
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; };