Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typo

...

This code fragment will split the content into lines, and call the first line, separated with by tabs, keys:

Code Block
TSVtoArrayOfMap = function(content){          // "A\tB\n1\t2\n3\t4\n"
  lines = content.split(lineBreakRE)          // ["A\tB","1\t2","3\t4"]
  keys = lines.head().split(9.chr()).          // ["A","B"]
  lines
    .tail()                                   // ["1\t2","3\t4"]
    .map(lineToMap)                           // [{"A":"1","B":"2"},{"A":"3","B","4"}]
}

...