Google Apps Script - Convert row data to dictionary

Converting a row data of a google spreadsheet to a dictionary is quite useful. Here is the snippet I wrote this morning:


With the dictionary format, you can access column data of that row easily, for example:

Logger.log(myDictData["username"]);

Pretty neat huh? \m/